I have two questions.
Do realloc()
and memcpy()
copy the entries in an array to another in a way faster than just iterating on eac
Some of the important points related to realloc(check on dev c++) : void *realloc(void *ptr, size_t size);
The realloc() function shall change the size of the memory object pointed to by ptr to the size specified by size.
The contents of the object shall remain unchanged up to the lesser of the new and old sizes.
If the new size is larger, the contents of the newly allocated portion of the object are unspecified.
If size is 0 and ptr is not a null pointer, the object pointed to is freed.
If ptr is a null pointer, realloc() shall be equivalent to malloc() for the specified size.
If ptr does not match a pointer returned earlier by calloc(), malloc(), or realloc() or if the space has previously been deallocated by a call to free() or realloc(), the behavior is undefined.