Answer Posted / nakul kumar
The simple answer is that a virtual destructor is one that is declared with the virtual attribute.
The behavior of a virtual destructor is what is important. If you destroy an object through a baller or reference to a base class, and the base-class destructor is not virtual, the derived-class destructors are not executed, and the destruction might not be complete.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is pair in c++?
Explain unexpected() function?
Should the this pointer can be used in the constructor?
What are advantages of using friend classes?
What are the uses of static class data?
What is abstract keyword in c++?
which operator is used for performing an exponential operation a) > b) ^ c) none
Where and why do I have to put the "template" and "typename" keywords?
You run a shell on unix system. How would you tell which shell are you running?
How to declaring variables in c++?
Explain what is class definition in c++ ?
How to declare a pointer to an array of integers?
What is the difference between new() and malloc()?
How to declare a function pointer?
What is polymorphism & list its types in c++?