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++ Language Reference - getch 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  with   echo.   Input   is
   unbuffered   and,  therefore, his routine will return as  soon  as   a
   character  is  available without waiting for a  carriage  return.  The
   character is not echoed to stdout.

   getch  is a direct call to DOS. It bypasses the normal  buffering done
   by getchar and getc.

   Note that ungetc cannot be used with getch.

   Example
   #include <conio.h>
   main()
   {
   int c;
   printf("Press a function key and then a character");
   c = getch();
   printf("\nCharacter [%c] is an example of getch",c);
   }

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


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