0
Why doesn't "cin >> ;" take input with spaces?
In multiple of my codes, I've made it so that the user has to put in a sentence that is stored in a string variable using cin. However, because sentences have spaces, it thinks it's been given multiple inputs, so it puts out the same number of outputs. Is there any way I can fix/work around this?
2 odpowiedzi
+ 4
use: std::getline(std::cin, variable_name);