Dynamic Memory Allocation :: free(3)
- Now that we can
malloc, calloc, andreallocwe need to be able to free the memory space if we have no use for it anymore. Like we mentioned above, any memory space that loses its pointer or isn't free'd is a memory leak. - So what's the prototype for
free(3)? Here it is:void free(void *ptr);
freesimply takes in a pointer to free. Not challenging at all. Note thatfreecan take in NULL, as specified by ANSI.