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 a manipulator in c++?

1239


What are the various storage classes in C++?

1142


What is type of 'this' pointer? Explain when it is get created?

1017


How much do coding jobs pay?

1019


Define a nested class.

1086


What is iomanip c++?

1081


List the special characteristics of constructor.

1184


Can a program run without main in c++?

1215


What is the use of data hiding?

1019


What is the output of the following program? Why?

1146


Which of the following is not a valid declaration for main() a) int main() b) int main(int argc, char *argv[]) c) They both work

1084


What is a far pointer? where we use it?

1077


Do you know the problem with overriding functions?

1111


Why should you learn c++?

1030


What are the syntactic rules to be avoid ambiguity in multiple inheritance?

1187