I have a text file that I want to read using C. It contains lines in this format: %d %d (%d or %lf)
. An example of 3 lines:
1 0 44
2 0 84.13
3 1 15.07
But the last number can be either int
or double
, arbitrary. How can I read from the text file regardless of the data type?