Date: Mon, 16 Nov 1998 17:22:11 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Won-Seok Lee 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: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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: > > > > 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).