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

Will a C compiler always compile C++ code a) Yes b) No c) Only optimized compilers

999


What is a loop? What are different types of loops in c++?

1062


Why do we learn c++?

908


What kind of problems can be solved by a namespace?

1015


Should you pass exceptions by value or by reference?

1090


How c functions prevents rework and therefore saves the programers time as wel as length of the code ?

1039


What is the best free c++ compiler for windows?

1047


What are the basics of local (auto) objects?

1081


Write a program using merge () function to combine the elements of array x[ ] and y[ ] into array z[ ].

1008


How do you remove an element from a set in c++?

1032


Write about the stack unwinding?

1020


Which software is best for coding?

998


If there are two catch statements, one for base and one for derived, which should come first?

993


When one must use recursion function? Mention what happens when recursion functions are declared inline?

1134


How to implement is-a and has-a class relationships?

963