/* Greet2.cpp CIS 150 Dave Klick 2017-01-18 Basic C++ string input and output. Note: This is a variation of Greet.cpp that handles input with whitespace in it. */ #include // for: cin, cout, endl #include // for: string, getline using namespace std; int main() { string name; // reserves storage for user's name // get name from user cout << "Enter your name: "; // prompt user getline(cin, name); // stores keyboard input in variable: name // display personalized greeting cout << "Hello, " << name << '\n'; // '\n' is a newline cout << "Press to continue... "; cin.get(); return 0; }