读书人

vc6中怎么将“\U+00D7”转换成“×”

发布时间: 2013-08-09 15:16:24 作者: rapoo

vc6中如何将“\U+00D7”转换成“×”
vc6中如何将“\U+00D7”转换成“×”
[解决办法]

引用:
Quote: 引用:

WideCharToMultiByte

具体怎么做呢,我真的搞晕了。
//“\U+00D7”转换成“×”
#include <locale.h>
#include <stdio.h>
#include <windows.h>
char s[]="\\U+00D7";
wchar_t w;
char m[3];
int main() {
setlocale(LC_ALL,"chs");
sscanf(s,"\\U+%4X",&w);
WideCharToMultiByte(CP_ACP,0,&w,1,m,2,NULL,FALSE);
m[2]=0;
printf("[%s]\n",m);
return 0;
}
//[×]
//

读书人网 >C++

热点推荐