// Example 7.17, page 202 // Schaum's Outline of Programming with C++ by John R. Hubbard // Copyright McGraw-Hill, 1996 using namespace std; #include #include // Test-driver for the strcat() function: int main() { char s1[11] = "ABCDEFG"; char s2[4] = "XYZ"; // NOTA: s1 deve contenere spazio sufficiente a ricevere la stringa concatenata cout << "Before strcat(s1,s2):\n"; cout << "\ts1 = [" << s1 << "], length = " << strlen(s1) << endl; cout << "\ts2 = [" << s2 << "], length = " << strlen(s2) << endl; strcat(s1,s2); cout << "After strcat(s1,s2):\n"; cout << "\ts1 = [" << s1 << "], length = " << strlen(s1) << endl; cout << "\ts2 = [" << s2 << "], length = " << strlen(s2) << endl; return 0; }