I do not know much about the sscanf function, but what I am trying to do is iterate through a line of integers. Given the variable
char *lineOfInts >
char *lineOfInts
Read much more about sscanf(3) and strtol(3)
Notice that sscanf returns the number of scanned elements and accepts the %n conversion specifier (for the number of consumed char-s). Both are extremely useful in your case. And strtol manages the end pointer.
sscanf
%n
char
strtol
So you could use that in a loop...