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

Explain rtti.

1136


Differentiate between a constructor and a destructor in c++.

1052


What is protected inheritance?

1096


Explain the pure virtual functions?

1167


What is the difference between mutex and binary semaphore?

1291


What is this pointer in c++?

1484


What is a class template?

1132


Explain the auto storage classes in c++.

1152


What does floor mean in c++?

1111


What is c++ try block?

1088


Can a class be static in c++?

1144


Define a pointer to a data member of the type pointer to pointer?

1035


Explain the term memory alignment?

1302


What is c++ iterator?

1216


What's the "software peter principleā€?

1193