Functions HI-TECH C REALLOC
void * realloc(void * ptr, size_t cnt)
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.
malloc, calloc, realloc