free() in c

The free() function in C library allows you to release or deallocate the memory blocks which are previously allocated by calloc(), malloc() or realloc() functions. 
It frees up the memory blocks and returns the memory to heap. It helps freeing the memory in your program which will be available for later use.


free() Syntax:
free(ptr);

Here, ptr is the memory block that needs to be deallocated

Posted on by