Question: 4. Write a C function with prototype char* cat (char* s1, char* s2) that takes two null (10) char arrays s1 and s2, allocates sufficient

4. Write a C function with prototype char* cat (char* s1, char* s2) that takes two null (10) char arrays s1 and s2, allocates sufficient heap memory to store the concatenation of the two arrays (including a terminating null (\0) character), copies the contents of arrays s1 and s2 into that newly alocated array (including the terminating null (10) character), then returns a pointer to the new char array. You may not use functions from the string.h library to accomplish the above tasks, in particular, you must manually determine the length of char arrays s1 and s2 by searching for their terminating null characters
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
