#include <iostream>using namespace std;
class A
{
public:
A(){ cout << "A() "; }
~A(){ cout << "~A() "; }
};
class B : public A
{
public:
B(){ cout << "B() "; }
~B(){ cout << "~B() "; }
};
class C : public B
{
public:
C(){ cout << "C() "; }
~C(){ cout << "~C() "; }
};
int main()
{
C* p = new C();
delete p;
}
Login in to like
Login in to comment