RAD Studio |  |

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

Copy Code

    #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) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!