偶然想起如何用c++直接输出宽字符,所以还是记下来吧
# include<iostream>
using namespace std;
int main()
{
//要想输出宽字符,加上这句就可以了
wcout.imbue(locale("", LC_CTYPE));
wchar_t str[] = L"宽字符";
char s[] = "字符";
cout << sizeof(str) << endl;
wcout << str << endl;
cout << s << endl;
cout << sizeof(s) << endl;
wchar_t ch = L'7';
wcout << ch << endl;
system("pause");
return 0;
}