W
W. Cerven
I have a list of n inputs of varying type I wish to read from a file:
For example:
string string int int double double int int int double ...
My input file gives its values on a single line, separated by spaces
or tabs.
However, only the first k<=n of these values are given. Without
knowing beforehand what k is, how do I read these k values to my
variables and stop reading when I reach the end of the line?
Thanks!
For example:
string string int int double double int int int double ...
My input file gives its values on a single line, separated by spaces
or tabs.
However, only the first k<=n of these values are given. Without
knowing beforehand what k is, how do I read these k values to my
variables and stop reading when I reach the end of the line?
Thanks!