64,645
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
using namespace std;
class A
{
public:
A()
{
p = this;
}
~A()
{
if (p!=NULL)
{
delete p;
p = NULL;
}
}
private:
A *p;
};
int main()
{
A a;
return 0;
}