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...

what is virtual destructor

Answer Posted / kamil mohamed

virtual destructor is recommended when you want to destroy
(delete) an object through it's parent pointer. This good
habit enforces proper cleanup of derived classes

Example:

class Employee {
virtual ~Employee() {}
};

class Manager : public Employee {
~Manager() {}
}

Manager * m = new Employee();
delete m; // <--

Is This Answer Correct ?    6 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the advantages of inheritance.

1129


How do you achieve polymorphism?

1068


what type of question are asked in thoughtworks pair programming round ?

2198


what are the ways in which a constructors can be called?

2114


What are objects in oop?

1083


what are the different types of qualifier in java?

2253


What makes a language oop?

1034


which feature are not hold visual basic of oop?

2184


Why is destructor used?

1008


What is oops?what is its use in software engineering?

1016


Why we use classes in oop?

1017


What is polymorphism give a real life example?

1024


Write A Program to find the ambiguities in Multiple Inheritance? How are they resolved.(Virtual Functions)

4131


Are polymorphisms mutations?

1140


What is a class oop?

989