#include <iostream>
using namespace std;
class Box{
public:
Box(){
cout << "Box构造函数创建" << endl;
}
~Box(){
cout << "Box析构函数调用" << endl;
}
};
int main()
{
double *ptr = NULL;
ptr = new double;
*ptr = 29494.99;
cout << "*ptr的值:" << *ptr << endl;
delete ptr;
cout << "-----对象数组创建销毁示例-------" << endl;
Box *BoxArray = new Box[4];
delete []BoxArray;
return 0;
}