delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/10/09/02:29:43

Message-Id: <1.5.4.32.19961009060235.006b6910@ans.com.au>
Mime-Version: 1.0
Date: Wed, 09 Oct 1996 16:02:35 +1000
To: djgpp AT delorie DOT com
From: Nicholas FitzRoy-Dale <wzdd AT mailhost DOT net>
Subject: Trouble with getche()

>I'm trying to do this simple little C thing, but it won't work right...I
>copied it right out of a C book.

>After I compile it, I run it and the cursor just goes to next line
>(which is blank) and does nothing. Then, for example, I type p it says:
>
>pType a character:
>You typed: p

Many C compilers "buffer" their output, which means they don't send it
anywhere until a certain amount of data has been recieved, or until a
newline (\n) has been sent.  I think DJGPP is line-buffered, ie, will not
output until a newline is sent.  In that case, the command fflush(stdio)
will flush the buffer for you.  Put the command after the first printf().

-/\/icholas 
wzdd AT mailhost DOT net (for regular email)
nicholas AT ans DOT com DOT au (for files & lists)


- Raw text -


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