Program : constructor, destructor in single inheritance


#include<iostream.h>
class base
{
public:
base()
{
cout<<"Inside base constructor"<<endl;
}
~base()
{
cout<<"Inside base destructor"<<endl;
}
};//end of base class


class derived : public base
{
public:
derived()
{
cout<<"Inside derived constructor"<<endl;
}
~derived()
{
cout<<"Inside derived destructor"<<endl;
}
};//end of derived class


void main()
{
derived obj;
}

1 comment:

  1. I'm really impressed with your writing skills and also with the layout on your blog. Is this a paid theme or did you customize it yourself? Either way keep up the excellent quality writing, it is rare to see a nice blog like this one these days.

    Feel free to visit my webpage natural cellulite treatment

    ReplyDelete