string name = "John"; // declaration and initialization name = "Carl"; // assignment cout << "Please enter your name:"; // output cin >> name; // input (stops at first space)
getline(cin, name);to read all keystrokes until the Enter key; e.g. should the user type
Harry Hacker