reading a character from the keyboard without waiting for the enter/return key

  • Follow


hello. could anybody post here the C source code for a 
portable unix program (i mean that it should be compiled under any unix system)

that reads a character form the keyboard
WITHOUT WAITING FOR THE RETURN KEY and without echoing it?

i mean the unix equivalent of the following dos-win code:

#include <conio.h>
int main(){
int c;
c=_getch(); 
return(0);
}
0
Reply mlcopag 2/5/2004 7:45:46 PM

mlcopag@yahoo.it (M. L. C.) writes:

> hello. could anybody post here the C source code for a portable unix
> program (i mean that it should be compiled under any unix system)
> 
> that reads a character form the keyboard
> WITHOUT WAITING FOR THE RETURN KEY and without echoing it?

Use the FAQ, Luke :-)

http://www.faqs.org/faqs/unix-faq/programmer/faq/

Look at 3.2 How can I read single characters from the terminal?

Joe
-- 
I think people should be able to make up their own minds for me
  - Monty Python
0
Reply joe 2/5/2004 7:51:29 PM


1 Replies
976 Views

(page loaded in 0.052 seconds)

Similiar Articles:













7/22/2012 8:17:01 AM


Reply: