Question: 1 . ) Concatenating arrays c + + Strings have built - in functions to perform concatenation, but char arrays do not have any built

1.) Concatenating arrays c++
Strings have built-in functions to perform concatenation, but char arrays do not have any built-in functions. Write a function called append() that performs concatenation for two char arrays (you will have to pass in a third char array that will hold the result). You will also need to pass in the lengths of each char array. You may not use strings or any functions from the string library for this part.
Sample main code:
char first[]=I am ;
char second[]={'i','r','o','n','m','a','n','\0'};
// Remember c-strings end in a '\0'(NULL) character so the above
// c-strings are 6 and 8 characters in length, respectively.
char result[200];
append(first,6, second, 8, result);
cout << result;
Example output for code above:
I am ironman

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 Programming Questions!