偷偷拿来记录一下萌新的cs路——day 34
#include<iostream>
using namespace std;
class Base {
public:
Base() {
cout << "Base构造函数" << endl;
}
~Base() {
cout << "Base析构函数" << endl;
}
};
class Son {
public:
Son() {
cout << "Son构造函数" << endl;
}
~Son() {
cout << "Son析构函数" << endl;
}
};
void test01() {
Base b;
Son s;
}
int main() {
test01();
return 0;
}
运行结果: