adspace
What is a virtual destructor? Explain the use of it?
Answer Posted / Neelam
A virtual destructor in C++ ensures that all derived class objects are properly destroyed, even if they were created through pointers to their base class. This is crucial when dealing with polymorphic objects.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers