Gooday
i have a question to make a program using the connect function and all i hve done is below. how do i complete the the first loop and the second loop...on what i should do next here is my code so far, explaination will be appreciated....
#include <iostream>
using namespace std;
void connect( char *s1, const char *s2 ) {
while ( *s1 != '\0' ) {
//how do i complete this loop
}
while ( *s2 != '\0' ) {
// how do i complete this loop? and how do i assign each character of s2 to s1.
}
}
int main()
{
char string1[ 20 ];
char string2[ 20 ];
cout << "Enter two strings: ";
cin >> string1 >> string2;
connect( string1, string2 );
cout << string1 << endl;
return 0; // indicates successful termination
} // end main
my goal is to cme up withan outcome of
Enter two strings: abc cba
abccba