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++?



What is the difference between a constructor and a destructor in C++?..

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

More C++ General Interview Questions

when can we use copy constructor?

6 Answers   HP,


Do class method definitions?

0 Answers  


Write about a nested class and mention its use?

0 Answers  


What are the effects after calling the delete this operator ?

0 Answers  


How many types of scopes are there in c++?

0 Answers  


What are c++ manipulators?

0 Answers  


Can I learn c++ as my first language?

0 Answers  


Given an array of size N in which every number is between 1 and N, determine if there are any duplicates in it. You are allowed to destroy the array if you like. [ I ended up giving about 4 or 5 different solutions for this, each supposedly better than the others ].

1 Answers  


What is the benefit of c++?

0 Answers  


Which bit wise operator is suitable for putting on a particular bit in a number?

0 Answers  


What is a volatile variable in c++?

2 Answers  


How do pointers work?

0 Answers  


Categories