When the job or task assigned to the allocated block of memory is over, that memory block needs to be freed up so that it can be used by another application. To free up the dynamically allocated memory, the free function is used. Here is its syntax:
free(pointer);
Here, pointer represents the pointer to the allocated memory.
Let's now begin with our first recipe!