Thread: I need help as soon as possible.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Apr 2003
    Posts
    2,663
    It doesn't matter whether there is one space or 100 spaces or even 20 newlines separating each piece of data, the operator>> will do the job as long as the data is separated by whitespace(is your data actually separated by dashes?). The operator>> is programmed to skip all leading whitespace and terminate reading at the first whitespace it encounters. Applying those rules to the example input you posted(assuming the dashes are really spaces): the first time operator>> is used, it reads in "SUV" and stops after reading in the 'V'. Then because operator>> skips leading whitespace, the next time operator>> is used it will skip to the 'E' in "Escape" and start reading in data and then stop after reading in the 'e'. The next time operator>> is used it will skip to the beginning of the number sequence, start reading, and then stop after reading in the '8'.
    Last edited by 7stud; 11-08-2005 at 04:24 PM.

Popular pages Recent additions subscribe to a feed