
need help on direct keyboard input
Quote:
>Hi,expert:
> I used programing in Basic language, there is a function name "
> inkey$", it will get one character from keyboard and do something.
> now, I would like to make a similar function in C, I try getchar()
> read() and other input function. they won't process the input unless
> you press Enter on you keyboard, is there somebody know how can
> program it in C?
> Thank you for any suggestion
The C language does not support anything specific for that type
of input. Each o/s has a specific solution for this. For DOS
platforms, you can use the non-ANSI function getch() which
should be available in all DOS compilers. You might also want
to look at kbhit(). However, your code will not be portable to
other platforms.
--
Airborne Geophysics
Geological Survey of Canada, Ottawa