Question: PROGRAMMING IN C! I would like to know how I would resize a dynamically allocated array in C WITHOUT using the realloc function or memcpy(only
PROGRAMMING IN C!
I would like to know how I would resize a dynamically allocated array in C WITHOUT using the realloc function or memcpy(only using malloc/calloc and then the free function to clear the allocated memory in the heap).
I know I would need to copy the data over somehow but not sure how exactly. The new array could be smaller or could also be bigger, so it would obviously need to work both ways..
Thank you :)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
