... in which case the immediate solution to the problem is to:
seek F, 0, 0;
immediately before the inner while loop (see seek).
To the OP:
But reading the same input file multiple times is a poor design. Reading from disk is order(s) of magnitude more expensive than reading from RAM. Much better to read the file once, storing its data in a suitable data structure, and then iterate over that data structure as needed.
BTW, some consistent indentation would go a lo-o-ong way towards making the code more readable (and the problem more tractable).
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re^2: Foreach/While - Why does this run AFTER that?
by Athanasius
in thread Foreach/While - Why does this run AFTER that?
by CalebH
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |