GETCHE(DOS) XENIX System V GETCHE(DOS)
Name
getche - Gets and echoes a character.
Syntax
#include <conio.h>
int getche ( );
Description
The getche function reads a single character from the
console and echoes the character read. If a CONTROL-C is
typed, the system executes an INT 23H (CONTROL-C exit).
Return Value
getche returns the character read. There is no error
return.
See Also
cgets(DOS), getch(DOS)
Example
#include <conio.h> #include <ctype.h>
int ch;
/* Get a character from the keyboard and echo it to the **
console. If it is an upper case letter, convert it ** to
lower case and write over the old character. */
ch = getche ( );
if (isupper (ch)) cprintf ("\b%c",tolower (ch));
Notes
This call must be compiled with the -dos flag.
Page 1 (printed 8/7/87)