I'm studying file I/O. I have a trouble in reading specific data.
text file :
index (x,y)
1 2,3 1,5 8,2
2 4,4
3 0,1 9,4
4
The number of (x,y)
can be changed.
I read only numbers with following code:
while (1){
getNum = fscanf(fp, "%d", &num);
if (getNum == EOF)
break;
else if (getNum < 1)
fscanf(fp, "%*[^0-9]");
else
printf("%d\t", num);
}
How can I split index, x, y?
Follow these steps: