c语言中输出一个宽字符
#include<iostream>
int main() {
//把本地语言默认设置成中文
setlocale(LC_ALL, "chs");
//定义宽字符
wchar_t c2 = L'国';
//输出宽字符
wprintf(L"%lc", c2);
system("pause");
return 0;
}
可以转换成用windows的通用格式
#include<tchar.h> int main() { TCHAR str[] = "中国心"; _tprintf("%s\n", str); system("pause"); return 0; }
posted on 2018-07-22 17:35 mengtianwxs 阅读(813) 评论(0) 收藏 举报
浙公网安备 33010602011771号