www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/11/16/13:28:25

Date: Mon, 16 Nov 1998 17:22:11 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Won-Seok Lee <lws AT inmac3 DOT snu DOT ac DOT kr>
cc: djgpp AT delorie DOT com
Subject: Re: Question about the operation of printf()
In-Reply-To: <199811160855.RAA24582@inmac3.snu.ac.kr>
Message-ID: <Pine.SUN.3.91.981116171938.8995F-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

On Mon, 16 Nov 1998, Won-Seok Lee wrote:

> if this program is compiled and made executable by
> the gcc.exe of the DJGPP, the result is the following:
> 
> <no output>
> 
> and when I press a button (for example, b),
> then the output is
> 
> ba
> 
> and the program terminates.

Output is line-buffered, to increase performance.  Add a call to fflush 
after printf and the program will behave like you expect.

This is explained in more detail in section 9.4 of the DJGPP FAQ list 
(v2/faq211b.zip from the same place you got DJGPP).

- Raw text -


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