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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started