Free since 2005 · No login required
AT

Academic Tutorials

Learn at your own pace

site-mobile-top-banner · 320x50

Difference between realloc() and free()?

Realloc() is used to reallocate the memory for variable.Realloc()used to resize the memory held by the pointer to the number of bytes specificed.If the new size is larger than current size, new memory is allocated. If it is less, the remaining (additional) bytes are released to general OS/application consumption. Free() is used to free the allocated memory of a variable.