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

Write some differences between an external iterator and an internal iterator?

1087


Is java a c++?

1105


Will this c++ program execute or not?

1162


What is doubly linked list in c++?

1130


What is the full form of stl in c++?

1241


What is the v-ptr?

1217


Why main function is special in c++?

1176


What is const in c++?

1159


What is a local variable?

1134


write a c++ program to create class student having datamember name,Roll_no,age,and branch intilcization all the member using constructor print the all the details on the screen.

2751


Write a program to find the reverse Fibonacci series starting from N.

1352


What will the line of code below print out and why?

794


What is void pointer in c++ with example?

1133


Can we inherit constructor in c++?

1146


You have two pairs: new() and delete() and another pair : alloc() and free(). Explain differences between eg. New() and malloc()

1226