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 are function prototypes?

1186


what do you mean by volatile variable?

981


Explain mutable storage class specifier.

1030


Why #include is used?

1006


Explain how to initialize a const data member.

1071


Explain the volatile and mutable keywords.

1029


How would you use the functions randomize() and random()?

1022


What is #include c++?

1045


Will a catch statement catch a derived exception if it is looking for the base class?

962


What is a lambda function c++?

1031


What is constant in c++ with example?

1076


What are pointers used for c++?

1007


What is overloading unary operator?

1026


Explain the differences between list x; & list x();.

959


Write a program for Divide a number with 2 and Print the output ( NOTE: Check for divide by zero error).

1058