...

C: Getting a char from keyboard without enter?

lsbt100
12-09-2002, 11:58 PM
I am using a linux box Red Hat 8.0, and need to write a small C prog that gets a single char from the keyboard without pressing enter.

On some platforms getch() (from connio.h) does this, but this does not exist on the box I am using?

What header file doe I need in Linux and what function do I need to use??

Thanks,

Lloyd

djdante97
12-10-2002, 06:50 AM
It doesn't appear that linux is capable of that in it's default mode. check out this link to find out why:http://www.ale.org/archive/ale/ale-2000-07/msg00442.html
-Dan

lsbt100
12-10-2002, 04:56 PM
Thanks for the link - at least I now know the problem, but for some reason I can't get that code compiling on my Linux box.

Bosko
12-10-2002, 07:57 PM
You could use ncurses.
Btw why is it so important that you don't have to press enter?If you use the C++ function getline,you can speficy some other character than return.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum