C Run-Time Library Reference
realloc
change memory allocation
Synopsis
#include <stdlib.h>
void *realloc(void *ptr, size_t size);
Description
The
function changes the memory allocation of the object
realloc
pointed to by
ptr
those in the object pointed to by
greater than the size of the object pointed to by
newly allocated section are undefined.
If
is a non-null pointer that was not allocated with
ptr
the behavior is undefined. If
. If
malloc
size
Error Conditions
If memory cannot be allocated,
returns a null pointer.
Example
#include <stdlib.h>
int *ptr;
ptr = (int *)malloc(10);
ptr = (int *)realloc(ptr, 20);
See Also
calloc, free,
malloc
3-110
to
. Initial values for the new object are taken from
size
ptr
is a null pointer,
ptr
is zero and
is not a null pointer,
ptr
ptr
VisualDSP++ 3.5 C/C++ Compiler and Library Manual
. If the size of the new object is
, then the values in the
ptr
realloc
realloc
remains unchanged and
/* intervening code
/* the size is now 20
for ADSP-219x DSPs
or
,
malloc
calloc
imitates
imitates
free
realloc
*/
*/
.
Need help?
Do you have a question about the VISUALDSP++ 3.5 and is the answer not in the manual?
Questions and answers