Question: In C++Language Implement a C-string function with the prototype below: void combine(const char v[], const char w[], char buffer[]); Assume that v and w represent
In C++Language
Implement a C-string function with the prototype below:
void combine(const char v[], const char w[], char buffer[]);
Assume that v and w represent two C-strings of possibly different lengths. After the function is called, buffer will contain the characters of v and w interleaved, starting with the first character of v (assuming v is nonempty). If one of the two C-string is shorter than the other then the function should just copy the remaining characters of the other C-string into buffer. Make sure to null terminate buffer so that it's a valid C-string. You may assume that buffer is big enough hold all the characters of the interleaved C-string.
Here are two examples:
If v is "abc" and w is "uvxyz" then buffer will be "aubvcxyz".
If v is "" (the empty string) and w is "xyz" then buffer will be "xyz".
*Program should include your combine function along with a main that calls combine with C-stings of different lengths for the first two arguments, along with a char array for the third argument. After the call to combine, your program should output the resulting C-string in the char array.*
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
