Mail Archives: djgpp-workers/1999/04/06/21:22:58
> Suppose we define fflush(FILE *stream) as
>
> flush the buffer associated with the stream
If stdin is the keyboard, the "buffer" will be the remainder of the
line (or maybe it won't), but if stdin is a file (i.e. redirected
input), then the "buffer" will be 512 bytes or more, depending on
where in the file you are (djgpp's slow-start buffering, remember?),
up to the size of the transfer buffer.
It would be bad if fflush(stdin) threw away your entire input file, yes?
I think that this problem alone is enough to choose to not actually
try to flush the input buffer.
Portable programs will use scanf("%*[^\n]\n"); anyway.
- Raw text -