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 the main use of c++?
Difference between linked list and array?
Write any small program that will compile in "C" but not in "C++"?
When to use Multiple Inheritance?
What are exceptions c++?
What is "mutable" keyword?
write a c++ program that gives output 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 using looping statement
What is the difference between a template and a macro?
What are vectors used for in c++?
if i want cin 12345678910 and cout abcdefghij. so how can i create the program?. example : if i key in 8910 so the answer is ghij.
What is function overriding in c++?
What are different types of loops in c++?