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/C++ v10.0 : C library - <b>synopsis:</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <conio.h>
    int getch( void );

Description:
    The getch function obtains the next available keystroke from the
    console.  Nothing is echoed on the screen (the function  getche will
    echo the keystroke, if possible).  When no keystroke is available, the
    function waits until a key is depressed.

    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
    getch 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 getch returns a value for
    the extended function.

See Also:
    getche, kbhit, putch, ungetch

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

    void main()
      {
        int c;

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

Classification:
    WATCOM

Systems:
    All

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