adplus-dvertising
frame-decoration

Question

If in multiple inheritance, class C inherits class B, and Class B inherits class A. In which sequence are their destructors called, if an object of class C was declared?

a.

~C() then ~B() then ~A()

b.

~B() then ~C() then ~A()

c.

~A() then ~B() then ~C()

d.

~C() then ~A() then ~B()

Answer: (c).~A() then ~B() then ~C()

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. If in multiple inheritance, class C inherits class B, and Class B inherits class A. In which sequence are their destructors called, if an object of class C was declared?