View Single Post
Posts: 726 | Thanked: 345 times | Joined on Apr 2010 @ Sweden
#2
The ">>" operator takes the line from cin and puts it into the string (as with lotion in a basement).

This means that if you want to handle the input "b mediaplayer" as two parts, you need to tokenize it yourself.

An easy way is to look at the method getline and use ' ' (space) as the line delimiter. This way you can split input data (but make sure to handle the case when there is no space) and do whatever you want with the second part.