Mail Archives: djgpp/1999/10/26/05:42:53
Ryan wrote:
> But what If I want to go straight to line 15 and read that line?
Besides the other suggestions, there's one that frequently gets
overlooked: read the entire file into memory, then scan the buffer
counting \n characters; when you have seen 14 of them, you are at the
beginning of line 15.
Given the amount of memory available to you in DJGPP, this is much
simpler than messing with fseek, fscanf, and the like. More often than
not, it will be also faster.
- Raw text -