Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / guest

If your class has at least one virtual function, you should
make a destructor for this class virtual. This will allow
you to delete a dynamic object through a baller to a base
class object. If the destructor is non-virtual, then wrong
destructor will be invoked during deletion of the dynamic
object.

Is This Answer Correct ?    8 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of "new" operator?

1125


What is the use of setprecision in c++?

1010


What is the advantage of an external iterator.

1039


What is the use of dot in c++?

1080


Define anonymous class.

1068


Is swift faster than c++?

1017


What is the object serialization?

1141


What are the important differences between c++ and java?

1142


Assume studentNames and studentIDs are two parallel arrays of size N that hold student data. Write a pseudocode algorithm that sorts studentIDs array in ascending ID number order such that the two arrays remain parallel.

2198


How do you invoke a base member function from a derived class in which you’ve overridden that function?

1106


What is diamond problem in c++?

996


What is linked list in c++?

1129


Difference between strdup and strcpy?

1203


If dog is a friend of boy and boy is a friend of house, is dog a friend of house?

997


What is the C-style character string?

1145