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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!