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?



What is virtual destructors? Why they are used?..

Answer / 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

More C++ General Interview Questions

What are the types of pointer?

0 Answers  


Why the usage of pointers in C++ is not recommended ?

0 Answers   TCS,


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

0 Answers  


What do you mean by abstraction in C++?

1 Answers  


Which is the best c++ compiler?

0 Answers  


Write a program to swap 2 chars without using a third varable? char *s = "A"; char *p = "B";

7 Answers   CTS,


What parameter does the constructor to an ofstream object take?

0 Answers  


What is a hash function c++?

0 Answers  


When is the last time you coded in C/C++? What is the most lines of original C/C++ code you have personally written in one project? How confident are you in your ability to write C or C++ without a reference?

1 Answers   Microsoft,


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

0 Answers  


Are there any new intrinsic (built-in) data types?

1 Answers  


What is vector pair in c++?

0 Answers  


Categories