adplus-dvertising
frame-decoration

Question

Choose the correct sequence of destructors being called for the following code:
class A{ };
class B{ };
class C: public A, public B{ };

a.

~A(), ~B(), ~C()

b.

~B(), ~C(), ~A()

c.

~A(), ~C(), ~B()

d.

~C(), ~B(), ~A()

Answer: (d).~C(), ~B(), ~A()

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Choose the correct sequence of destructors being called for the following code: