Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ 3.0r4 - <b>getch</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
getch

Usage

   #include <conio.h>
   int getch(void);

Description

   getch obtains a character from stdin. Input is unbuffered and, therefore,
   this routine will return as soon as a character is available without
   waiting for a carriage return. The character is not echoed to stdout.
   getch bypasses the normal buffering done by getchar and getc. ungetc
   cannot be used with getch.

Example 

   #include <conio.h>
   #include <stdio.h>
   #include <stdlib.h>

   int main()
   {

       int c;
       printf("Press a function key and then a character");
       c = getch();
       printf("\nCharacter [%c] is an example of getch",c);
       return EXIT_SUCCESS;
   }

Return Value

   Returns the next character read. getch never returns an error.

See Also

   fgetc, getc, getchar, getche, putc, putchar, ungetc



See Also: fgetc getc getchar getche putc putchar ungetc

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