This is a terminal app, and this is the entirety of the program. I noticed if I supply input of something like 12345 and then hit enter in the terminal window, after hitting enter, I see one response line from the program which reads "input recv". However if I enter "1 2 3 4 5" as an input string I get 5 lines of "input recv" sequentially output in the terminal window.
What exactly is happening? I'm a bit confused on this.
Notice that the istream extraction operations use whitespaces as separators; Therefore, this operation will only extract what can be considered a word from the stream. To extract entire lines of text, see the string overload of global function getline.
Elsewhere:
Extracts characters from is and stores them ..., stopping as soon as ... a whitespace character is encountered
Internally, the function accesses the input sequence by first constructing a sentry object (with noskipws set to false).
noskipws==false means same as skipws==true
skipws ... leading whitespaces are discarded before formatted input operations.