#include
#include
class base
{
public:
base( )
{
cout<<"Constructing base n";
}
~base( )
{
cout<<"Destructing base n";
}
};
class derived: public base
{
public:
derived()
{
cout<<"Constructing derived n";
}
~derived( )
{
cout<<"Destructing derived n";
}
};
main( )
{
clrscr();
derived *d = new derived();
base *b = d;
delete b;
getch();
}