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 destructors? Why they are used?

Answer Posted / hrpynux@gmail.com

Virtual destructors in C++ are used to avoid memory leaks especially when your class contains unmanaged code, i.e., contains pointers or object handles to files, databases or other external objects. A destructor can be virtual. ... Now, suppose you create an instance of the Derived class using a Base class pointer.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is constructor in C++?

1088


What are the rules about using an underscore in a c++ identifier?

1187


When do we use copy constructors?

1083


Can I create my own functions in c++?

1087


Can we specify variable field width in a scanf() format string? If possible how?

1259


What is private inheritance?

1097


Can the operator == be overloaded for comparing two arrays consisting of characters by using string comparison?

1079


Write some differences between an external iterator and an internal iterator?

1020


What is the fastest c++ compiler?

1104


Which should be more useful: the protected and public virtuals?

1037


Explain the concept of copy constructor?

1047


Can I uninstall microsoft c++ redistributable?

1114


What do you mean by delegate? Can a user retain delegates?

947


Describe exception handling concept with an example?

1048


What is flag in computer?

1051