#include <iostream>
using namespace std;
class A
{
public:
A(){}
};
int main()
{
A *a = new A;
/*
* delete a;
* delete a;
*如果释放2次,程序就会挂掉,最好delete之后把a赋值为NULL,每次使用的时候再来判断下,最好不要把对象指针被别的类保存,这样存在风险(在其他类中释>放了该对象)
*/
if (a)
{
delete a;
}
return 0;
}