SilverScreen Solid Modeler

realloc

realloc

Previous topic Next topic  

realloc

Previous topic Next topic JavaScript is required for the print function  

StandardCLibrary

 

void *realloc( void *p, size_t s )

 

void   *p;        /* address of a previously allocated piece of memory */

size_t  s;        /* new size in bytes */

 

 




Synopsis

#include "stdlib.h"

 

The realloc function changes the size of the object pointed to by p to the size indicated by s . The contents of p will be unchanged unless s is smaller than its original size.

 

 

Parameters

p is the address of a piece of memory previously allocated from the heap (as if by malloc, calloc, etc.). s is an integer specifying the new size of the memory block.

 

 

Return Value

realloc returns a pointer to the new region if successful, and NULL if not, in which case the contents of p are left unchanged.

 

 

See Also

malloc, calloc, free