|
Cet article a fait l'objet d'une traduction automatique. Déplacez votre pointeur sur les phrases de l'article pour voir la version originale de ce texte. Informations supplémentaires.
|
Traduction
Source
|
_getch, _getwch
Important
|
|---|
|
|
int _getch( void ); wint_t _getwch( void );
|
|
|
|
|
|---|---|---|---|
|
_gettch |
_getch |
_getch |
_getwch |
|
|
|
|---|---|
|
_getch |
|
|
_getwch |
|
// crt_getch.c
// compile with: /c
// This program reads characters from
// the keyboard until it receives a 'Y' or 'y'.
#include <conio.h>
#include <ctype.h>
int main( void )
{
int ch;
_cputs( "Type 'Y' when finished typing keys: " );
do
{
ch = _getch();
ch = toupper( ch );
} while( ch != 'Y' );
_putch( ch );
_putch( '\r' ); // Carriage return
_putch( '\n' ); // Line feed
}
type « O » d'abcdeylorsque le type de clés terminé : O
Important