Detecting string chars??

Pages: 12
closed account (z05DSL3A)
Well basically if the user enters "1 2" into the cin stream, when you do cin >> a only the the first part of the stream (up to the first whitespace) in put into a. So a has a single char '1' in it, your loop processes this without a problem and then returns to get the next thing out of the cin stream.

getline will take all the user input and put it in a, and non of the if statement will match and it will drop into the final else.
ok so getline gets the whole text and cin just to the first space?
closed account (z05DSL3A)
Yep.
Tnx m8 ^^
Topic archived. No new replies allowed.
Pages: 12