#include
#include
class first
{
public:
virtual ~first( )
{
cout<<"n DEATH OF OBJECT OF CLASS FIRST" ;
}
};
class second : public first
{
public:
~second( )
{
cout<<"n DEATH OF OBJECT OF CLASS SECOND" ;
}
};
class third : public second
{
public:
~third( )
{
cout<<"n DEATH OF OBJECT OF CLASS THIRD" ;
}
};
class fourth : public third
{
public:
~fourth( )
{
cout<<"n DEATH OF OBJECT OF CLASS FOURTH" ;
}
};
main()
{
clrscr();
fourth *d = new fourth();
first *b=d;
delete b;
getch();
}