setlocale(LC_ALL,"chs"); string s="你好abc"; wstring ws=L"你好abc"; printf("%s\n",s.c_str()); wprintf(L"%s\n",ws.c_str());//为什么要设置locale才能正确的wprintf? 已经知道了是宽字符的,为何还要设置代码页? 为什么string/printf就不需要设置locale也能工作?
65,186
社区成员
250,526
社区内容
加载中
试试用AI创作助手写篇文章吧