123456789
#include <iostream> int main() { using namespace std; char name[20]; cin.get(name,19); cout << "Name : " << name; return 0; }
123456789101112131415
#include <iostream> using namespace std; int main() { string name; cout << "Please enter your full name> " << flush; getline( cin, name ); cout << "\nHello " << name << ".\nCan I call you " << name.substr( 0, name.find_first_of( " \t" ) ) << "?\n"; return 0; }