// Example 7.18, page 203 // Schaum's Outline of Programming with C++ by John R. Hubbard // Copyright McGraw-Hill, 1996 using namespace std; #include #include // Test-driver for the strncat() function: int main() { char s1[] = "ABCDEFG"; char s2[] = "XYZ"; cout << "Before strncat(s1,s2,2):\n"; cout << "\ts1 = [" << s1 << "], length = " << strlen(s1) << endl; cout << "\ts2 = [" << s2 << "], length = " << strlen(s2) << endl; strncat(s1,s2,2); cout << "After strncat(s1,s2,2):\n"; cout << "\ts1 = [" << s1 << "], length = " << strlen(s1) << endl; cout << "\ts2 = [" << s2 << "], length = " << strlen(s2) << endl; return 0; } // NOTA: BACO DI OVERFLOW