3. (TCO 5) Write a function named processStrings that will havethree parameters;
ID: 3529196 • Letter: 3
Question
3.(TCO 5) Write a function named processStrings that will havethree parameters; two character arrays and an integer. The arguments to be passed to the function are shown below:
charstr1[] ="Hello";
charstr2[] =" World!";
intlength = 0;
The integer parameter will be passed by reference. The function will be a void function. The function will copy str1 into str2 and then calculate the length of str1 (the calculated length will be assigned to the length parameter). The function must use functions in the cstring library. Do not write a main function. Your function does not docinorcout.
Explanation / Answer
void processStrings(char str1[], char str2[],int &length){
strcpy (str2,str1);
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.