Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ Language Reference - free http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
   free

   Usage
   #include <stdlib.h>
   void free(void *p);

   Description
   free releases memory pointed to by p. p must have been allocated using
   calloc,  malloc,  or realloc. p can be NULL, in which case  free  does
   nothing

   Caution: do not free data items more than once or refer to data  after
   it has been freed.
   If  free detects that the heap has become corrupted it will abort  the
   program with an error messsage.

   Example
   #include <stdio.h>
   #include <stdlib.h>
   main()
   {
   char *p;
        if((p = malloc(1000)) == NULL);
             printf("Unable to allocate memory\n");
        free(p);
   }

See Also: calloc malloc realloc

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson