free
Free
Memory
from
Allocation
Syntax
#include <memory.h>
int
free(pointer)
char
·pointer;
free
Description
This routine deallocates a packet
of
memory (pointed to
by
pointer) previ-
ously allocated by mal/oc, cal/oc, or real/oc.
If
you attempt
to
free a packet
not
previously allocated, the function takes no action and returns. Refer
to
Section 6.1.1, Specifying the Size
of
Memory
to
Manage,
for
more infor-
mation on allocating memory.
Example
char
*x;
x =
malloc(lO);
free(x);
/*
allocate
10
bytes
*/
/*
free
10
bytes
*/
6-7