1// extract to string
2#include <iostream>
3#include <string>
4
5int main ()
6{
7 std::string name;
8
9 std::cout << "Please, enter your full name: ";
10 std::getline (std::cin,name);
11 std::cout << "Hello, " << name << "!\n";
12
13 return 0;
14}
1//getline allows for multi word input including spaces ex. "Jim Barens"
2#include <iostream>
3#include <string>
4
5int main()
6{
7 string namePerson{}; // creating string
8 getline(cin, namePerson);// using getline for user input
9 std::cout << namePerson; // output string namePerson
10}