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

What is class in c++ with example?

560


What happens when you make call 'delete this;'?

593


Write a struct time where integer m, h, s are its members?

511


Write a note about the virtual member function?

594


What is c++ map?

553






What causes a runtime error c++?

568


How can you prevent accessing of the private parts of my class by other programmers (violating encapsulation)?

634


What is the two main roles of operating system?

506


Can I learn c++ without learning c?

554


What are formatting flags in ios class?

599


Which of the following is evaluated first: a) && b) || c) !

1789


Does there exist any other function which can be used to convert an integer or a float to a string?

641


Is c++ an integer?

564


Comment on assignment operator in c++.

697


Define token in c++.

703