Difference between realloc() and free?
Both realloc() and free() are functions of C programming language used for dynamic memory allocation. Both of the functions are defined in the stdlib.h library.
realloc() : It is a function which is used to dynamically reallocate memory space to an already dynamically allocated memory space to a variable.
free() : It is used to deallocate or free the dynamically allocated memory space allocated to a variable and thus make it available to other variables or other memory functions of the operating system.
Image for free() function
Image for realloc() functions