来自「C语言相关程序」· 代码 · 共 28 行

TXT
28
字号
#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 + =
减小字号Ctrl + -
显示快捷键?