#include <iostream.h>
class point	//point 类的定义
{
public:	//外部接口
	point(int a=0, int b=0);	//构造函数
	point(point &p);	//拷贝构造函数
    ~point();
    void display(void);
	void move(int xx,int yy);
private:	//私有数据
	int x;
	int y;
};
//成员函数的实现
point::point(int a,int b)
{
	x=a;
	y=b;
    cout<<"x="<<x<<" 构造函数被调用"<<endl;
}
point::~point()
{
	cout<<"x="<<x<<" 析构函数被调用"<<endl;
}
point::point(point &p)
{
	x=p.x;
	y=p.y;
	cout<<"x="<<x<<" 拷贝构造函数被调用"<<endl;
}
void point::display(void)
{
	cout<<"x="<<x<<" y="<<y<<endl;
}
void point::move(int xx,int yy)
{
    x+=xx;
	y+=yy;
}
//主程序
int main()
{
	point A(4,5);	
	point B(A);	
    point C;
	C=point(1,1);//用无名对象初始化C
	B.move(2,2);
	A.display();
	B.display();
    C.display();
    return(0);
}
