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 the difference between a constructor and a destructor in C++?

Answer Posted / nashiinformaticssolutions

While a destructor is used to remove class objects, a constructor aids in initializing them. Both are invoked automatically: the constructor allocates memory instantly upon creating a new object, and the destructor deals with memory when destroying an existing one.

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 pointer with example?

977


Which one is better- macro or function?

1122


What are the effects after calling the delete this operator ?

989


What does new in c++ do?

963


What is std :: flush?

1002


What do you mean by stack unwinding in c++?

1175


Give 10 points of differences between C & C++.

1085


what is scupper?

2319


What are the basics of local (auto) objects?

1077


What is the difference between #define debug 0 and #undef debug?

1125


Where and why do I have to put the "template" and "typename" keywords?

978


What is the difference between object-oriented programming and procedural programming?

1153


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

1130


Will the following program execute?

990


What do you mean by inheritance in c++?

1021