Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C Library Reference - <u>synopsis:</u> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <conio.h>
    int getche( void );

Description:
    The getche function obtains the next available keystroke from the
    console.  The function will wait until a keystroke is available.  That
    character is echoed on the screen at the position of the cursor (use
     getch when it is not desired to echo the keystroke).

    The  kbhit function can be used to determine if a keystroke is
    available.

Returns:
    A value of EOF is returned when an error is detected; otherwise, the
    getche function returns the value of the keystroke (or character).

    When the keystroke represents an extended function key (for example, a
    function key, a cursor-movement key or the ALT key with a letter or a
    digit), zero is returned and the next call to getche returns a value for
    the extended function.

Example:
    #include <stdio.h>
    #include <conio.h>

    void main()
      {
        int c;

        printf( "Press any key\n" );
        c = getche();
        printf( "You pressed %c(%d)\n", c, c );
      }

Classification:
    WATCOM

Systems:
    All, Netware

See Also:
    getch, kbhit, putch, ungetch

See Also: getch kbhit

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson