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

Can an interface inherit a class?

1009


What is oops and why we use oops?

988


What makes a language oop?

1006


What is the main feature of oop?

1097


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

4077


What is an example of genetic polymorphism?

1116


Can we create object of abstract class?

1028


What is difference between oop and pop?

1102


Why do while loop is used?

974


What are the data types in oop?

1044


What is class and object in oops?

1062


What is polymorphism programming?

1068


Describe these concepts: Polymorphism, Inheritance and Abstraction.

1138


What is byval and byref? What are differences between them?

2147


What exactly is polymorphism?

1070