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


Please Help Members By Posting Answers For Below Questions

How can you say that a template is better than a base class?

678


Is std :: string immutable?

655


What is fflush c++?

661


What is polymorphism in c++? Explain with an example?

690


What is the basic of c++?

706






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?

664


Explain virtual destructor?

800


What kind of problems can be solved by a namespace?

694


Explain some examples of operator overloading?

754


What is #include iostream in c++?

674


What is the full form of ios?

646


What is a buffer c++?

671


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?

1840


Differentiate between the message and method in c++?

688


If a header file is included twice by mistake in the program, will it give any error?

648