_getwch
函数简介函数原型:wint_t _getwch( void );
函数功能:类似于getch()
所属库:
Routine
Required header
Compatibility
_getch
<conio.h>
Windows 95, Windows 98, Windows 98 Second Edition, Windows Millennium Edition, Windows NT 4.0, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003
_getwch
<conio.h> or <wchar.h>
Windows 95, Windows 98, Windows 98 Second Edition, Windows Millennium Edition, Windows NT 4.0, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003
相关函数:
Tchar.h routine
_UNICODE and _MBCS not defined
_MBCS defined
_UNICODE defined
_gettch
_getch
_getch
_getwch
备注:wint_t说明见于stdio.h
typedef unsigned short wchar_t;
typedef wchar_t wint_t;
由此可见wint_t即unsigned short
程序示例[1]
#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( '
' ); // Carriage return
_putch( '
' ); // Line feed
}