Question: Write a Program in C to copy the contents a one-dimensional character array into another one-dimensional character array. Include two functions in your program, one
Write a Program in C to copy the contents a one-dimensional character array into another one-dimensional character array.
Include two functions in your program, one which demonstrates the functionality using pointer notation and one which demonstrates the functionality using array indexing. The function prototypes are below:
void copyArrayIndexWay(char * const newArray1, const char * const originalArray1);
void copyPointerWay(char *newArray2, const char *originalArray2);
char originalArray1[] ="HOME25351";
char originalArray2[] = "HOME25341";
Extra: Include relevant print statements to explain what the difference between the two functions.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
