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...

How do you allocate and deallocate memory in C++?

Answer Posted / hrpynux@gmail.com

Use the malloc() function to allocate memory in designated blocks and the new function to create a new function. To reallocate memory, the realloc() function is used. When finished, always include a free() function in order to free up the memory. If you used new(), use delete() to free up the memory.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which one is a preferred language C or C++? Why?

1094


Why do we use classes in c++?

1062


What are the characteristics of friend functions?

1016


What does it mean to declare a destructor as static?

1085


What is increment operator in c++?

1025


What is #include c++?

1136


What are files in c++?

1041


Difference between delete and free.

1079


What does getch() do according to the ANSI C++ standard a) Reads in a character b) Checks the keyboard buffer c) Nothing in particular (Its not defined there)

1055


Write a recursive program to calculate factorial in c++.

1081


Should I learn c or c++ first?

1126


What is the full form of ios?

1072


What is fixed in c++?

1040


Why cout is used in c++?

1026


Can you please explain the difference between static and dynamic binding of functions?

1033