Question: Specification Implement your version of strcat, called my_strcat. Implementation Download file lab4strcat.c. This program reads two words (strings with no spaces) from the user, stored


Specification Implement your version of strcat, called my_strcat. Implementation Download file lab4strcat.c. This program reads two words (strings with no spaces) from the user, stored them into arrays a and b. It then copies the inputs into another two arrays c and d, using library function strcpy. Then it calls strcat to concatenate a and b, and calls my_strcat to concatenate c and d. If implemented correctly, a and C should have the same content. The program terminates when user enters two xxx. Implement function void my_strcat(char []). Obviously, function should not call library function strcat. Also should not create extra temporary arrays in the function. Complete the while loop so that it keeps on prompting the user for inputs, and terminates when both two input strings are xxx, as shown in the sample output. Use strcmp library function to check the termination condition. Sample input, output (assume each input has less than 30 characters and contains no space.) red 118 % a.out hello worlds strcat: helloworlds mystrcat: helloworlds good ok strcat: goodok mystrcat: goodok hi g strcat: hig mystrcat: hig goodluck thanks strcat: goodluckthanks mystrcat: goodluckthanks xxx good strcat: xxxgood mystrcat: xxxgood xxx strcat: yyxxx mystrcat: yyxxx xxx xxx red 119 % #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
