-

Difference between revisions of "Functions HI-TECH C REALLOC"

From HI-TECH C for CP/M Fan WIKI(EN)
Jump to: navigation, search
(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...")
 
(No difference)

Latest revision as of 23:08, 31 July 2017

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