-

Functions HI-TECH C REALLOC

From HI-TECH C for CP/M Fan WIKI(EN)
Revision as of 23:08, 31 July 2017 by Kumokosi (talk | contribs) (Created page with "<strong>REALLOC</strong> ==SYNOPSIS== void * realloc(void * ptr, size_t cnt) ==DESCRIPTION== <strong>Realloc</strong>() frees the block of memory at ptr, which shoul...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

REALLOC

SYNOPSIS

void * realloc(void * ptr, size_t cnt)


DESCRIPTION

Realloc() frees the block of memory at ptr, which should have been obtained by a previous call to malloc(), calloc() or realloc(), then attempts to allocate cnt bytes of dynamic memory, and if successful copies the contents of the block of memory located at ptr into the new block. At most, realloc() will copy the number of bytes which were in the old block, but if the new block is smaller, will only copy cnt bytes. If the block could not be allocated, 0 is returned.

SEE ALSO

malloc, calloc, realloc