The code you posted is a clarification of the question.
The end of a input to string in this context is any whitespace character.
For an integer, it is any non-numeric character.
Not exactly. A space or newline or tab is a valid character in a string.
It simply means that the formatted input operation stops, and any further characters are left in the input buffer.