Answer to Question #234710 in C++ for SOM

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

}

};



1
Expert's answer
2021-09-08T16:03:49-0400
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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS