Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

here is some code for your convenience #include #include #define SIZE 30 int main(){ char a[SIZE]; char b[SIZE]; char c[SIZE]; char d[SIZE]; scanf(%s,a); scanf(%s,b); while

image text in transcribed

here is some code for your convenience

#include #include #define SIZE 30 int main(){ char a[SIZE]; char b[SIZE]; char c[SIZE]; char d[SIZE]; scanf("%s",a); scanf("%s",b); while ( ){ strcpy(c,a); strcpy(d,b); strcat(a,b); mystrcat(c,d); printf("strcat: %s ", a); printf("mystrcat: %s ", c); } } void my_strcat(char a[], char b[]){ }
A Implementation Download file . 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 temporary arrays. 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. You are encouraged to use strcmp library function to check the termination condition. 5.3 sample input, output (assume each input has less than 20 characters and contains no space.) red 118 $ a.out hello worlds strcat: helloworlds mystrcat: helloworlds good ok strcat: goodok mystrcat: goodok hi

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Sham Navathe,Ramez Elmasri

5th Edition

B01FGJTE0Q, 978-0805317558

More Books

Students also viewed these Databases questions