But if there are say 25 lines in the file, you know that you want to start with line 5.
so do a
Qt Code:
  1. void rewind ( fp );
  2. int posn = 5;
  3. while((c = fgetc("file.txt")) != EOF){
  4. if(c == '\n') lines++;
  5. if(lines >= posn) // now at the required position in file - print the rest
  6. }
To copy to clipboard, switch view to plain text mode