Why would you make a destructor virtual?
Answer Posted / sunny bogawat
we make destructure as virtual because when we derived a
class from base class then destructor called from derived
to base so for this happening correctly we haveto make base
class destructor as avirtual.
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How can you say that a template is better than a base class?
Is std :: string immutable?
What is fflush c++?
What is polymorphism in c++? Explain with an example?
What is the basic of c++?
How can you quickly find the number of elements stored in a static array? Why is it difficult to store linked list in an array?
Explain virtual destructor?
What kind of problems can be solved by a namespace?
Explain some examples of operator overloading?
What is #include iostream in c++?
What is the full form of ios?
What is a buffer c++?
what is the difference between linear list linked representaion and linked representation? what is the purpose of representing the linear list in linked represention ? is it not avoiding rules of linear represention?
Differentiate between the message and method in c++?
If a header file is included twice by mistake in the program, will it give any error?