What is a virtual destructor?
Answers were Sorted based on User's Feedback
Answer / munendra 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 pointer 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 |
Answer / 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 |
What is a container class? What are the types of container classes in c++?
Can the operator == be overloaded for comparing two arrays consisting of characters by using string comparison?
Is it possible to have a recursive inline function in c++?
How do you find out if a linked-list has an end? (I.e. The list is not a cycle)
What is the difference between a declaration and a definition?
Define the operators that can be used with a pointer.
What are static variables?
What is isdigit c++?
What is a terminating character in c++?
What are the advantages of c++?
Why was c++ made?
How can we read/write Structures from/to data files?