www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/05/16/07:07:14

Date: Sun, 16 May 1999 14:02:15 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Ike <drone AT ismi DOT net>
cc: djgpp AT delorie DOT com
Subject: Re: fflush(stdout)?
In-Reply-To: <373e18fb@news.ismi.net>
Message-ID: <Pine.SUN.3.91.990516135930.26252b-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

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.

- Raw text -


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