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 are structs in c++?
WHAT IS THE ABREVATION OF FORTRAN?
How do I use turbo c++?
In which situation the program terminates before reaching the breakpoint set by the user at the beginning of the mainq method?
How does c++ sort work?
Can a constructor be private?
What is an accessor in c++?
What is a custom exception?
What is a forward referencing and when should it be used?
what are prototypes
In what situations do you have to use initialization list rather than assignment in constructors?
What does the following do: for(;;) ; a) Illegal b) Loops forever c) Ignored by compiler...not illegal