Mail Archives: djgpp-workers/1998/06/28/12:09:00
> fread(&i, sizeof(i), 1, f);
> /* now the buffer is newly allocated because it was
> reset after the last fseek and because of the read,
> in the _flag (member of FILE) is the last operation
> set to read */
> i = -1;
> fwrite(&i, sizeof(i), 1, f);
Are you allowed to follow a fread with an fwrite without a seek or
flush inbetween? The ANSI spec says you must call fseek, fflush,
fsetpos, or rewind between read and write operations on the same
stream.
- Raw text -