Consider following code and state the order of execution constructors and order of execution of destructors.
class C: public A, virtual public B
{ public:
C( ):A( ),B( )
{
cout<<”c class constructor”;
}
};
The order of execution will be;
Constructor of the base class A A() will be executed.
Constructor of the base class B B() will be executed.
Constructor of the class C C(){cout<<”c class constructor”;} will be executed.
Comments
Leave a comment