www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/05/11/01:47:07

Date: Tue, 11 May 1999 08:44:19 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Alain Magloire <alainm AT rcsm DOT ece DOT mcgill DOT ca>
cc: djgpp-workers AT delorie DOT com
Subject: Re: Quirky getch() (fwd)
In-Reply-To: <199905101750.NAA16951@mccoy2.ECE.McGill.CA>
Message-ID: <Pine.SUN.3.91.990511084358.7567A-100000@is>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Mon, 10 May 1999, Alain Magloire wrote:

> printf ("hello world\n");
> printf ("Enter key: ");
> getch();
> 
> The last printf() was not flush, I did not expect it to show.

People generally expect the results be displayed in sequence.  If I
would to write such a fragment, I would add a call to fflush before
getch, but too many newbies don't.

Also, I believe that if I would need the "Enter key: " prompt to
appear after getch returns, I would have switched their order in the
source instead of relying on the output to be deferred.

- Raw text -


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