CPlusPlusThings/practical_exercises/10_day_practice/day5/构造函数与析构函数/没有构造函数的派生类.cpp
Light-City a4d828bb4c update
2020-04-06 00:57:02 +08:00

16 lines
262 B
C++

#include <iostream>
using namespace std;
class A {
public:
A(){ cout<<"Constructing A"<<endl; }
~A(){ cout<<"Destructing A"<<endl; }
};
class B:public A {
public:
~B(){ cout<<"Destructing B"<<endl; }
};
int main(){
B b;
system("pause");
}