📄
字号:
#include<iostream.h>
class location
{
public:
location(int xx=0,int yy=0)
{X=xx,Y=yy;};
location(location & p);
int GETX()
{return X;}
int GETY()
{return Y;}
private:
int X,Y;
};
location::location(location & p)
{
X=p.X;
Y=p.Y;
cout<<"Copy_constructor called."<<endl;
}
main()
{
location A(1,2);
location B(A);
cout<<"B:"<<B.GETX()<<","<<B.GETY()<<endl;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -