Correct use of Realloc
realloc returns a pointer to the resized buffer; this pointer value may be different from the original pointer value, so you need to save that return value somewhere. realloc may return NULL if the request cannot be satsified (in which case the original buffer is left in place). For that reason, you want to save … Read more