C Function References
C Useful Resources
Copyright © 2014 by tutorialspoint
C - free function
void free(void *mem_address);
A block of memory previously allocated using a call to malloc, calloc or realloc is deallocated, making it availbale again for further allocations.
int main ()
int * buffer1, * buffer2, * buffer3;
buffer1 = (int*) malloc (100*sizeof(int));
buffer2 = (int*) calloc (100,sizeof(int));
buffer3 = (int*) realloc (buffer2,500*sizeof(int));
It will proiduce following result:
This program has no output.
This is just demonstration of allocation and deallocation of memory.