www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/04/06/21:22:58

Date: Tue, 6 Apr 1999 21:22:50 -0400
Message-Id: <199904070122.VAA03572@envy.delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: djgpp-workers AT delorie DOT com
In-reply-to: <7aa6585.243c053e@aol.com> (Kbwms@aol.com)
Subject: Re: v2.03 release: what else has to be done?
References: <7aa6585 DOT 243c053e AT aol DOT com>
Reply-To: djgpp-workers AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> 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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019