C++ Virtual Functions Question:

Download Job Interview Questions and Answers PDF

Explain virtual destructor?

C++ Virtual Functions Interview Question
C++ Virtual Functions Interview Question

Answer:

If the destructor in the base class is not made virtual, then an object that might have been declared of type base class and instance of child class would simply call the base class destructor without calling the derived class destructor.

Download C++ Virtual Functions Interview Questions And Answers PDF

Previous QuestionNext Question
Explain data encapsulation?What is the use of Vtable?