I need to make my code shorter. In a way that, if a user is asked what his/her name is, they only need to input one line and the program will reply with the whole input
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#include <iostream>
#include <string>
usingnamespace std;
int main ()
{
string x;
cout << "What is your name?";
cin>>x;
cout <<"Hello, "<<x;
system("pause");
return 0;
}
so far in my code, only the first name is displayed. Any ideas guys? Thanks in advance!