C++
Difference between realloc() and free()?

See All Responses Below...
Author
Message Rating
Posted on: 20/05/2012
realloc function allocates or re- sizes the memory already allocated and free function frees the memory allocated in the heap. If you allocated the memory in the heap using malloc or any related functionj, then you need to call the free function when that variable is out of scope. When to free the variable depends upon your functional requirements..

Tom
Posted on: 201 2/5/20
Share this page across other social networking sites



Please Login to Post Your Comments
Name (Max. 100 characters)
Please post your comments here
Select Language
Comments
Attach File(Max. Size: 2 MB)
A few simple rules when posting your Comments,
  1. Please post only answers relevant to the topic of discussion.
  2. Please dont misuse this site or do not be abusive, offensive, inappropriate,harass anyone on the boards or post ads or spam. Doing so will delete your inappropriate messages and will block or delete your account on this site.