C++ MQCs with Explanation (CHAPTER : INHERITANCE : EXTENDING CLASSES

Consider the following class definition with inheritance: class A : public B, virtual public C { }; The order of execution of constructors will be:

  1. A ( ), B ( ), C ( )
  2. C ( ), B ( ), A ( )
  3. B ( ), C ( ), A ( )
  4. A ( ), C ( ), B ( )



Answer: 
Option c: B ( ), C ( ), A ( )

Explanation Here

Post a Comment

0 Comments