#include #include using namespace std; int main() { int x; char name1[10]; char name2[10]; // room for 9 chars, plus '\0' terminator cout << "Enter a number: "; cin >> x; // need to get rid of the extra '\n' here, before the next input cin.get(); // read one char, throw away result // this will read the extra '\n' in the way cout << "Enter first name: "; cin.getline(name1, 10); cout << "Enter last name: "; cin.getline(name2, 10); cout << "x = " << x << '\n'; cout << "name1 = " << name1 << '\n'; cout << "name2 = " << name2 << '\n'; strcat(name1, name1); // cout << "name1 = " << name1 << endl; }