I want read a txt file that has up to 10 lines. The file is formatted like this on all lines:
1 1 8
2 2 3
3 1 15
4 2 7
I\'m trying to write a f
You were nearly done but you simply need to change the format specifier.The following code reads through the lines preceding your intended line,but ignores what it reads.
for (ii=0 (ii = 1; ii < (lineNum-1); ii++)
{
/*move through lines without scanning*/
fscanf(f, "%*d %*d %*d%*c");
// fscanf(f, "%*d %*d %*d\n");
}
fscanf(f,"%d%d%d",&num1,&num2,&num3);