[Solved] Scan input from file line by line [closed]
If you’re going to do this with fscanf, you want to use a scan set conversion, like: int a, b; char c[256]; fscanf(infile, “%d %d %[^\n]”, &a, &b, c); To scan all the lines in the file, you’d do something like: while (3 == fscanf(infile, “%d %d %[^\n]”, &a, &b, c)) process(a, b, c); fscanf … Read more