LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Programming question (https://www.linuxquestions.org/questions/linux-software-2/programming-question-27564/)

LinuxQuest01 08-09-2002 09:10 AM

Programming question
 
Hi,

I have a C question, hope you guys can help me. I would like to read a single character from input. Now one can do this using scanf or getchar. However, I would like to read it as soon as the user press the key. In other words, the user doesn't have to hit the <Enter> key in order for the character to be processes.

Does anyone know how to do this? I remember doing it before, but it's been a while...

Thanks in advanced.

bbeers 08-09-2002 09:24 AM

Would fread() do the trick?

-bbeers

LinuxQuest01 08-09-2002 11:28 AM

No, I just try that function and it requires the <enter> key to be press... thanks though

bbeers 08-09-2002 11:42 AM

Well, ... maybe you could poll() or select() and catch the input ?

-bbeers


All times are GMT -5. The time now is 03:02 AM.