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 the difference between public and private data members?

1234


Why can templates only be implemented in the header file?

1142


What is the difference between a reference and a pointer?

1182


Write a code/algo to find the frequency of each element in an array?

1165


Explain about Virtual Function in C++?

1086


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

1066


What is the use of structure in c++?

1081


What is the function to call to turn an ascii string into a long?

1120


How does code-bloating occur in c++?

1241


When should overload new operator on a global basis or a class basis?

1134


What is auto used for in c++?

1109


Is c++ the hardest programming language?

1178


Are vectors faster than arrays?

1053


What it is and how it might be called (2 methods).

1262


What is the use of object in c++?

1154