Date: Sun, 16 May 1999 14:02:15 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: Ike cc: djgpp AT delorie DOT com Subject: Re: fflush(stdout)? In-Reply-To: <373e18fb@news.ismi.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Sat, 15 May 1999, Ike wrote: > What exactly does fflush(stdout) do It flushes any buffered output that wasn't written to the screen (or file, if stdout was redirected). > and why would it be used on stdout? When stdout is connected to the screen, it is line-buffered. This means that the characters are buffered until a newline is seen, and then the entire line is written to the screen. If you want the text to appear on the screen before the newline, you need to call fflush. > How is different for file streams? It isn't. File streams call the same buffered I/O functions under the hood.