Quote Originally Posted by Kitt3n View Post
Ok, I thought that what was behind the space would get trashed: I did not presumed it would be used again at a later time in the program.
See it like this:
Everytime you call cin >>, it will try to read from the input buffer. More specifically, it will read until it hits a whitespace.
If the input buffer is empty, it will try to read some data from the user and save it into the buffer. This buffer is line buffered, so it will read an entire line.
cin >> will extract a token, and when reading into a string, stops at the next whitespace.

So if you enter: Hello World
cin >> str1 reads "Hello". "World" is left in the input buffer.
cin >> str2 reads "World". Nothing is left in the input buffer.