getchar()

Burkhard Kirste kirste at methan.chemie.fu-berlin.de
Wed Mar 13 01:56:44 AEST 1991


edrury at 3cpu.UUCP (Ed Drury) writes:

>In article <5CTOV6E at methan.chemie.fu-berlin.de> kirste at methan.chemie.fu-berlin.de (Burkhard Kirste) writes:
>>storm at cs.mcgill.ca (Marc WANDSCHNEIDER) writes:
>>
>>>>	Your problem is that getchar() does not recognize ANY input until
>>>>you hit Enter.
>
> oh yes, much more complicated, you have to use #include <curses.h>
                                                 ^^^^^^^^^^^^^^^^^^^
>rather than #include <conio.h> -- but the question as I understand
[stuff deleted]
Well yes, but you forgot to mention that this is in no way all you
would have to do under Unix. You would have to call initscr() in the
beginning, endwin() in the end, and you have to replace your printf's
by printw's. And you have to link the curses library, which gives
you a lot of overhead if getch() is really all you need.

Alternatively, you can avoid the whole curses stuff and change the
terminal settings via ioctl(...) etc.
-- 
  |~|   Freie Universitaet Berlin, Institut fuer Organische Chemie
  / \   Burkhard Kirste    kirste at kristall.chemie.fu-berlin.dbp.de
 /FUB\  Takustrasse 3, D-1000 Berlin 33      UUCP: kirste at fub.uucp
 `---'  Telefon: (030)838-6484              Telefax: (030)838-5163



More information about the Comp.lang.c mailing list