delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/04/06/16:06:09

Date: Thu, 6 Apr 2000 19:18:46 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Bart Verbakel <B DOT Verbakel-ab AT student DOT fontys DOT nl>
cc: djgpp AT Delorie DOT com
Subject: Re: getch() with DJGPP
In-Reply-To: <38EC822B.230D4ECE@cafeetje.nl>
Message-ID: <Pine.SUN.3.91.1000406191729.8162C-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Thu, 6 Apr 2000, Bart Verbakel wrote:

> while ( getch() != 'q' )
>   printf("Neverending textstring");
> 
> This is SUPPOSED to put the string to stdout,
> until I touch the 'q' key.
> 
> But, compiling this with DJGPP and running it in an DOS-box
> under Win98, It does not!!
> After each 'printf' it waits for me to press "RETURN"

stdout is buffered.

Put an fflush(stdout) after printf, and it will do what you want.

See section 9.5 of the FAQ for more insight on this issue.

- Raw text -


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