#include
#include
class first
{
public:
~first( )
{
cout<<"n DEATH OF OBJECT OF CLASS FIRSTn";
}
};
class second : public first
{
public:
~second( )
{
cout<<"n DEATH OF OBJECT OF CLASS SECONDn" ;
}
};
class third : public second
{
public:
~third( )
{
cout<<"n DEATH OF OBJECT OF CLASS THIRDn" ;
}
};
class fourth : public third
{
public:
~fourth( )
{
cout<<"n DEATH OF OBJECT OF CLASS FOURTHn" ;
}
};
main()
{
clrscr();
fourth *d= new fourth;
first *b=d;
delete b;
getch();
}