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 c++ map?
Can char be a number c++?
Difference between struct and class in terms of access modifier.
What does the linker do?
Should I learn c++ c?
What is a pointer how and when is it used?
Out of fgets() and gets() which function is safe to use?
What is exception handling in C++?
Do we have to use initialization list in spite of the assignment in constructors?
How to access a variable of the structure?
Differentiate between C and C++.
What is the outcome of cout< a) 16 b) 17 c) 16.5