Read in one linne into several doubles?
Quote:
* You will read a line of data with either 1 double with the value -1, 3 doubles, or 4 doubles
* Numbers will be separate with a space, last number terminates with a newline
So basically, the input is going to be one line, but it could be one double, two, three, or four doubles.
How would I go about reading this input in? It would be easy if i knew there was going to always be 3 doubles, or if i knew there would always be four doubles. but how do i read one line into three doubles if three doubles are inputed into the one line, or only two doubles if only two doubles are inputted etc?
Thanks for the help.