What is the difference between strings and cin?

Like for example:

Cout << "UHHHHHHHH" << endl;
cin >> x;

cout << "UHHHHHHHH" << endl;
getline(cin,x);


What is the difference and when do you use each one of them?
if x is a string, cin >> x; will read only a single word, getline(cin,x); would read a whole line
Usually getline is the best choice
Topic archived. No new replies allowed.