#include "iostream"
using namespace std;
class A
{
public:
A() {constr();}
virtual ~A() {destr();}
virtual void constr() const {;}
virtual void destr() const {;}
};
class B: virtual public A
{
public:
B() {constr();}
~B() {destr();}
void constr() const {cout << "B" ;}
void destr() const {cout << "~B";}
};
int main()
{
A *a, *b;
a = new A;
b = new B;
delete b;
delete a;
}
Login in to like
Login in to comment