RAD Studio
ContentsIndex
PreviousUpNext
getche

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++ 
 
 
 
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!