Answers for "how to get string from user in cpp"

C++
1

how to get string from user in cpp

string firstName;
cout << "Type your first name: "; 
cin >> 
  firstName; 
  // get user input from the keyboard
cout << "Your name is: " << 
  firstName;

// Type your first name: John
// Your name is: John
Posted by: Guest on April-09-2021

Code answers related to "how to get string from user in cpp"

Browse Popular Code Answers by Language