Getting multiple lines of input with scanf() in c -
i trying grab multiple lines of input scanf, lines have same formatting example line:
1, 05:05:04, 1, 1103
the current code have grabs 1 line
scanf(" %d, %d:%d:%d, %d, %d", int1, int2, int3, int4, int5, int6);
are looking this?
while (scanf("%d,%d:%d:%d,%d,%d", &int1, &int2, &int3, &int4, &int5, &int6) == 6) { //use int1, int2, int3, int4, int5, int6 }
Comments
Post a Comment