#include<iostream>
#include<time.h>
using namespace std;
class teacheraa {
public:
int age;
teacheraa(int age) {
this->age = age;
cout << "全局对象构造" << endl;
}
~teacheraa() {
cout << "全局对象析构" << endl;
}
};
class student {
public:
int age;
student(int age) {
this->age = age;
cout << "局部对象构造" << endl;
}
~student() {
cout << "局部对象析构" << endl;
}
};
class teacher {
public:
int age;
teacher(int age) {
this->age = age;
cout << "静态对象构造" << endl;
}
~teacher() {
cout << "静态对象析构" << endl;
}
};
static teacher t(34);
teacheraa a(18);
int main() {
cout << "main()开始" << endl;
student s(10);
system("pause");
return 0;
}