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 c++ good for?

1059


What do you mean by inheritance in c++? Explain its types.

1133


How do you compile the source code with your compiler?

1051


How many namespaces are there in c++?

1071


What is the use of this pointer in c++?

1007


Can we use struct in c++?

1016


What is the best c++ ide?

1166


What are advantages of c++?

1020


What is an operator in c++?

1059


Why struct is used in c++?

1118


How do you add an element to a set in c++?

990


A company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9 percent of their gross sales for that week. For example, a saleperson who sells $5000 worth of merchandise in a week receives $200 plus 9 percent of $5000, or a total of $650. You have been supplied with a list of items sold by each salesperson. The values of these items are as follows: Item Value A 239.99 B 129.75 C 99.95 D 350.89 Write a program that inputs one salesperson's items sold in a week (how many of item A? of item B? etc.) and calculates and displays that salesperson's earnings for that week.

3890


What does new in c++ do?

1018


What do you mean by storage classes?

1579


Of the numbers 12 23 9 28 which would be at the top of a properly implemented maxheap a) 28 b) 9 c) Any of them could be

1415