Question: C Data Structures Write a C function with prototype char* cat(char* s1, char* s2) that takes two null (0) terminated char arrays s1 and s2,

C Data Structures
 C Data Structures Write a C function with prototype char* cat(char*

Write a C function with prototype char* cat(char* s1, char* s2) that takes two null (\0) terminated 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 allocated array (including the terminating null (\0) 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

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!