- #include
- using namespace std;
- #include
-
- //1.构造函数 进行初始化操作
- class Person
- {
- public:
- Person()
- {
- cout << "Person 构造函数的调用" << endl;
- }
- ~Person()
- {
- cout << "Person 析构函数的调用" << endl;
- }
- };
- //2.析构函数 进行清理操作
-
- void test01()
- {
- Person p;
- }
- int main()
- {
- test01();
- system("pause");
- return 0;
- }