fbpx

C++ Interview Question 16 Answer

Bjarne-stroustrup
 

Answer

This question is compilable and deterministic.

Its output is “abBA”.

Explanation

The base class constructor is called before the inherited constructor. The inherited destructor is called before the base class destructor.

SOURCE