1 / 2

Order of Execution of Constructors and Destructors in Inheritance

Order of Execution of Constructors and Destructors in Inheritance. class base { protected: int d1; public: base() { cout <<" ctor base"<< endl ; } base( int a):d1(a) { cout <<" ctor overloaded base"<< endl ; } ~base() { cout <<" dtor base"<< endl ; } };.

carys
Download Presentation

Order of Execution of Constructors and Destructors in Inheritance

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Order of Execution of Constructors and Destructors in Inheritance

  2. class base { protected: int d1; public: base() { cout<<"ctor base"<<endl; } base(int a):d1(a) { cout<<"ctor overloaded base"<<endl; } ~base() { cout<<"dtor base"<<endl; } }; class derive: public base{ protected: int d2; public: derive(): base(2) { cout<<"ctor derive"<<endl; } ~derive() { cout<<"dtor derive"<<endl; } };

More Related