What is the purpose of realloc( )?

sunina's Avatar
Banned
# What is the purpose of realloc( )?
samsmile007's Avatar
Newbie Member
Quote:
Originally Posted by sunina
# What is the purpose of realloc( )?
# if we run out of allocated memory during the run-time of our program and need to give our collection of items more memory
# Enter realloc(3), it's prototype:

void *realloc(void *ptr, size_t size);

realloc takes in the pointer to the original area of memory to enlarge and how much the total size should be