C++的开发问题

include

using namespace std;
struct Node
{
int x;
int y;

};
int main()
{
Node a;
Node *b;
a.x=5;
a.y=6;
cout<<a.x<<endl;
cout<<a.y<<endl;
cout<x<<endl;//后面两个是箭头,由点改为箭头,不知道为啥显示不出来。
cout<y<<endl;//
return 0;
}
结果前两个是5 6
我就想问后两个很长的数字是什么?求解。。谢谢。。

阅读 2.5k
2 个回答

其实不太懂你的问题表述...
你想得到的是不是这个?

#include <iostream>
using namespace std;
struct Node
{
int x;
int y;

};
int main()
{
Node a;
Node *b;
a.x=5;
a.y=6;
b=&a;
cout<<a.x<<endl;
cout<<a.y<<endl;
cout<<b->x<<endl;
cout<<b->y<<endl;
return 0;
}

运行输出:

5
6
5
6

你应该是打错了。
很长的数字可能是指针的值。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题