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
Maybe something like that :
#include int main(void) { const char * str = "10 202 3215 1"; int i = 0; unsigned int count = 0, tmp = 0; printf("%s\n", str); while (sscanf(&str[count], "%d %n", &i, &tmp) != EOF) { count += tmp; printf("number %d\n", i); } return 0; }