getche

De RAD Studio
Aller à : navigation, rechercher

Remonter à 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.

Remarque :  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++

+