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

Perform addition, multiplication, subtraction of 2-D array using Operator Overloading.

3876


Is c++ a float?

1066


How do you write a function that can reverse a linked-list?

1114


Explain container class.

1245


Explain the purpose of the keyword volatile.

1171


What are the benefits of c++?

1056


Can we overload operator in c++?

1042


How do I use arrays in c++?

1005


What is pointer with example?

1060


What is the full form of stl in c++?

1196


What is the use of data hiding?

1019


What is long in c++?

1249


What are exceptions c++?

1044


What is a .lib file in c++?

997


You have two pairs: new() and delete() and another pair : alloc() and free(). Explain differences between eg. New() and malloc()

1161