Please, could someone give me a hint?
I have to read numerical data from a text file. The numbers to be read from file have at most 8 algarisms. I tried to read the data using fscanf, but it doesn't work properly. Here an example of the numerical data which can be found in the file:
1234567812345678 1234567 123456 12345
That means, when the numbers have 8 algarisms, there are no spaces between then, but if they have less algarisms, there are some spaces.
If I write : fscanf(%8d,....etc), only the first two numbers are read correctly (12345678) but it fails for the following entries. The third entry is read as 12345671, the fourth as 23456123 and the fifth as 45
What should I do do read the numbers correctly, when spaces exist?
Or can't I use fscanf in this case?
It is possible to use another function, for example fread? Or fread works only with binary files?
Thanks for any help!!!