Question #234710

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”;

}

};



Expert's answer

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. 


 


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS