_getwch

王朝百科·作者佚名  2012-05-07  
宽屏版  字体: |||超大  

函数简介函数原型: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

}

 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
© 2005- 王朝百科 版权所有