mbctolow.c
来自「开放源码的编译器open watcom 1.6.0版的源代码」· C语言 代码 · 共 35 行
C
35 行
#include <stdio.h>
#include <mbctype.h>
#include <mbstring.h>
unsigned int chars[] = {
'A', /* single-byte A */
'B', /* single-byte B */
'C', /* single-byte C */
'D', /* single-byte D */
'E', /* single-byte E */
0x8260, /* double-byte A */
0x8261, /* double-byte B */
0x8262, /* double-byte C */
0x8263, /* double-byte D */
0x8264 /* double-byte E */
};
#define SIZE sizeof( chars ) / sizeof( unsigned int )
void main()
{
int i;
unsigned int c;
_setmbcp( 932 );
for( i = 0; i < SIZE; i++ ) {
c = _mbctolower( chars[ i ] );
if( c > 0xff )
printf( "%c%c", c>>8, c );
else
printf( "%c", c );
}
printf( "\n" );
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?