I have a string that holds a date in the format of "Year Day Step" That is, for example "2011 98 129300"
I want to take this line and assign the year/day/step as values to my Time class which is a struct with 3 unsigned integers: Year, Day and Step.
How do I take each chunk of characters seperated by space and assign as values to integers?
I can do this successfully for the first value, but I can't seem to make the 2nd and 3rd fields come out as anything but 0. I tried << with flush and I tried calling flush().
¿what the hell is lsub, and what is it doing?
Think of an istringstream as any istream (like cin), when you read numbers it will ignore the spaces and line breaks.
thanks I'll take a look
(lsub is a range with x being the start of the number and y being the terminating space. I use it to send substrings to the stringstream with .substr( )