Borland C++ reference

getch

raw OCR

Gets character from keyboard, does not echo to screen.

Defined in header <conio.h>

Syntax

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

Portability

DOSUNIXWindowsANSI CC++ only
■

Remarks

getch reads a single character directly from the keyboard, without echoing to the screen.

Return value

getch returns the character read from the keyboard.

See also

Example

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

int main (void)
 {
   int c;
   int extended  = 0;
   c = getch 0 ;
   if  (!c)
      extended  = getch();
   if  (extended)
      printfC'The  character is extended\n");
   else
      printfC'The  character isn't extended\n");

   return  0;

Differences from modern implementations

Nothing recorded yet.

Modern references

These are search links, not yet checked by hand.