Saturday, 10 November 2012

What is the order of calling for the constructors and destructors in case of objects of inherited classes? | Embedded Systems

The constructors are called with base class first order and the destructors are called in the child first order. That is, the if we have 2 levels of inheritance A (base)-> B (inherit 1)-> C (inherit 2) then the constructor A is called first followed by B and C. The C destructor is called first followed by B and A

No comments: