+ 1
how to output phrases?
as a (let's say, a "booster") to a larger project, i'm trying to output an inputted phrase(as in, the entire string) stored in a string, but only the first letter is displayed. any solutions? code i'm referencing: https://code.sololearn.com/c412kH3uod63
2 Respuestas
+ 1
Replace
cin >> s;
By
getline(cin, s);
cin read up to a separator which is by default any white space, so what you read is not a line but just the first word of the line.
0
Ever heard of std::getline?
http://en.cppreference.com/w/cpp/string/basic_string/getline