#include <iostream.h>
struct point
{
int x;
int y;
};
void main()
{
point pt;
pt.x=1;
pt.y=2;
cout<<"输出变量值:"<<endl;
cout<<pt.x<<endl<<pt.y<<endl;
cout<<"取一个地址(&取地址运算符,用以返回变量的指针,即变量的地址):"<<endl;
cout<<"pt.x与pt.y的地址:"<<&pt.x<<" "<<&pt.y<<endl;
}
class mya
{
public:
//构造函数
mya::mya()
{
}
//析构函数
~mya();
};
评论