C++ Programming/Code/Standard C Library/Functions/realloc

< C++ Programming < Code < Standard C Library < Functions

realloc

Syntax
#include <cstdlib>
void *realloc( void *p, size_t s);

The function realloc() resizes a block created by malloc() or calloc(), and returns a pointer to the new memory region.

If the resize operation fails, realloc() returns NULL and leaves the old memory region intact.

Related topics
calloc - free - malloc
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.