How do you know that your class needs a virtual destructor?

Answer Posted / melos

If the class will be derived from and it will need a virtual
destructor so that the destructor of the derived class will
be invoked if it referenced using the pointer to the base class.

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which sort does c++ use?

786


What is singleton pattern in c++?

708


What is the use of ::(scope resolution operator)?

820


What is a dynamic binding in c++?

698


Discussion on error handling of C++ .

836


C is to C++ as 1 is to a) What the heck b) 2 c) 10

825


What is the iunknown interface?

877


Why should we use null or zero in a program?

773


Tell me what are static member functions?

781


Do inline functions improve performance?

821


What is dynamic and static typing?

873


Where and why do I have to put the "template" and "typename" keywords?

780


Describe private, protected and public – the differences and give examples.

818


Difference between a copy constructor and an assignment operator.

754


What is c++ library?

786