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:
void rewind ( fp ); int posn = 5; while((c = fgetc("file.txt")) != EOF){ if(c == '\n') lines++; if(lines >= posn) // now at the required position in file - print the rest }To copy to clipboard, switch view to plain text mode
Bookmarks