From: "A.Appleyard" Organization: Materials Science Centre To: djgpp AT delorie DOT com Date: Wed, 9 Oct 1996 08:26:36 GMT Subject: Re: Trouble with getche() Message-ID: <7845A435CD@fs2.mt.umist.ac.uk> Tony Sideris wrote:- > ... copied it right out of a C book. ... > main() {char ch; printf("Type a character: "); > ch = getche(); printf("\nYou typed: %c", ch);} > [produces] > pType a character: > You typed: p In djgpp, output sent to stdout (= the screen, usually) by printf() is stored in a buffer, which is only flushed to the screen when a '\n' is sent to it or on exit from the program. After `printf("Type a character: ");' try inserting `fflush(stdout);'.