fstream at spaces rather then new line

This may be super simple. Not sure.

1. How would I read in from a file. But have the read in stop at a space rather
then a newline?
2. Make note I need to not skip 0's just spaces.
3. Also I then need to store the numbers as 5 separate int's.

if the file read
1
2
3
1 12 2010 45 45
4 12 2010 10 30
6 1 2011 4 45

etc....


Any help would be greatly appreciated.
file >> i; will read one integer (where file is an fstream and i is an int) and stop at the first non digit symbol. Put it in a loop and make it read values into an array.
I tried it and it worked great. I was overly complicating it on myself.
Topic archived. No new replies allowed.