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 size is allocated to the union variable?
What is the best it certification?
What is namespace std; and what is consists of?
Can you please explain the difference between using macro and inline functions?
What is a c++ object?
What are the weaknesses of C++?
How to stop conversions among objects?
What is a 'pure' virtual function and what's its use?
What will happen if a pointer is deleted twice?
Is dev c++ a good compiler?
Explain the need for "Virtual Destructor"?
What is the use of endl in c++ give an example?