Anyone got anything about reading a sequential number from text file per line and parsing it to an array in C?
What I have in a file:
12 3 45 6 7 8
3
I'd strongly suggest NOT to use sscanf and friends when the number of fields is variable. Use strtok and atoi. Just make sure to read the strtok manpage well, many programmers I know find its syntax a bit surprising in the beginning. Also note that strtok will modify the input string, so you may want to work on a copy.