Show: Delphi C++
Display Preferences

getche

From RAD Studio
Jump to: navigation, search

Go Up to conio.h Index

Header File

conio.h

Category

Console I/O Routines

Prototype

int getche(void);

Description

Gets character from the keyboard, echoes to screen.

getche reads a single character from the keyboard and echoes it to the current text window using direct video or BIOS.

Note: Do not use this function in Win32 GUI applications.

Return Value

getche returns the character read from the keyboard.

Example

#include <stdio.h>
#include <conio.h>
int main(void)
{
   char ch;
   printf("Input a character:");
   ch = getche();
   printf("\nYou input a '%c'\n", ch);
   return 0;
}

Portability

POSIX Win32 ANSI C ANSI C++

+

Personal tools
In other languages