realloc
Re-allocate
Memory
realloc
Syntax
#include
<memory.h>
char *realloc(ptr,newlength)
char
*ptr
;
/*number
of
items
to
clear * /
int
newlength ;
/*
new
size
of
packetĀ·
/
Description
This routine chan,ges the size
of
the allocated data
area
pointed
to
by
the
first argument,
ptr,
to
the size specified by the second argument,
newlength.
It
returns a pointer
to
the space allocated since the packet and
its contents may have
to
be moved in order
to
expand.
Any
memory freed
by this operation is deallocated.
If
an
error occurs, the
function
returns zero.
Refer
to
Section 6.1.1, Specifying the Size
of
Memory
to
Manage,
for
more
information on allocating memory.
6-13