Currently At: Programming Reference > C Reference > Standard C Memory > free()

free()


Syntax:
 #include <stdlib.h>


Description:
The free() function deallocates the space pointed to by ptr, freeing it up for future use. ptr must have been used in a previous call to |malloc()|, |calloc()|, or |realloc()|.

Example:
typedef struct data_type {
  int age;
  char name[20];
} data;
    
data *willy;
willy = (data*) malloc( sizeof(willy) );
...
free( willy );


Related Topics:
calloc(), malloc(), realloc()


Web Standards & Support:

Link to and support eLook.org Powered by LoadedWeb Web Hosting
Valid XHTML 1.0! Valid CSS! eLook.org FireFox Extensions