in reply to Re^2: getc skips ahead
in thread getc skips ahead

Note that the piece of information that gives it away is this: "in the problem file, [getc] returns 270, 782, 4367, 4368". You'd normally expect getc() to be reading one byte at a time, and therefore always returning numbers in the range 0..255; only if the file is being read in a different mode can larger integers be returned.

Update: misread the details.

Hugo

Replies are listed 'Best First'.
Re^4: getc skips ahead
by ysth (Canon) on Aug 15, 2004 at 19:57 UTC
    The original post sure sounds like he's doing getc, tell (for debugging), and something else in a loop, and the "270,782,..." are the results of the tell. The question is what is in that "something else" that advances the file pointer, and how getc's different return after binmode makes it work right.

      Oops, I misread that entirely, and ignored the fact that the "before" list of numbers were also greater than 255 to boot.

      Hugo