Question: Concatenating strings Purpose: manipulating strings using string functions while avoiding array out of bound To do Write a function that accepts an input three strings

Concatenating strings

Purpose: manipulating strings using string functions while avoiding array out of bound

To do Write a function that accepts an input three strings s1, s2, and outString and does the following: 2.1 Checks if s1 and s2 can be concatenated into a single string (use your function from part 1) 2.2 If the strings can be concatenated into a single string then 2.2.1 It copies s1 to outString 2.2.2 Concatenates s2 to outString 2.3 If the strings were concatenated then it return a 0 otherwise it returns a 1 Prototype int concatStrings(char *s1, char *s2, char *outString, int sizeOfOutstring); Using String functions strcpy() and strcat() in your code

Example char *s1 = Tutorial 3 ; char *s2 = is about strings!; char outString[25]; In this case a call to concatStrings() should return a 1; concatStrings(s1, s2, outString, 25)

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!