📄
字号:
#include<iostream.h>
class location
{
public:
set(int xx,int yy);
~location()
{
cout<<"wsrftg cvasdfd: "<<X<<", "<<Y<<endl;
};
private:
int X,Y;
};
location::set(int xx,int yy)
{
X=xx;
Y=yy;
cout<<"defsdgrt: "<<X<<","<<Y<<endl;
return 0;
};
void main()
{
location *ptr=new location[2];
ptr[0].set(5,10);
ptr[1].set(15,20);
cout<<"deleted..."<<endl;
delete[ ] ptr;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -