//Program to show the concept of constructor and destructor in single inheritance

| |


#include<iostream.h>
#include<conio.h>
class base
{
public:
base()
{
cout<<"base constructing…….\n";
}
~base()
{
cout<<"base destructing………\n";
}
};
class derived:public base
{
public:
derived()
{
cout<<"derived constructing………\n";
}
~derived()
{
cout<<"derive destructing…………\n";
}
};
void main()
{
derived d;
getch();
}
<