You are on page 1of 1

#include<iostream.

h>
#include<conio.h>
class first
{
public:
first()
{
cout<<endl<<"Constructor of first called";
}
~first()
{
cout<<endl<<"destructor of first called";
}
};
class second:public first
{
public:
second()
{
cout<<endl<<"constructor of second called";
}
~second()
{
cout<<endl<<"Destructor of second called";
}
};
void main()
{
clrscr();
first *p;
p=new second;
delete p;
getch();
}

You might also like