#include <iostream.h>
//struct Point
class Point
{
public:
int x; x、y作用域为 Point 调用 void init 函数 x、y的值发生改变
int y;
void init()
{
x=0;
y=0;
}
void output()
{
cout<<x<<endl<<y<<endl;
}
};
void main()
{
Point pt;
pt.init ();
// pt.x=5;
// pt.y =5;
// cout<<pt.x <<endl<<pt.y <<endl;
pt.output();
}