C++|wchar_t 简单认识

wchar_t输出用wcout

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <iostream>

using namespace std;

int main()
{
setlocale(LC_ALL, "chs");
wchar_t wc[] = L"中国";

wcout << wc << endl;

getchar();
return 0;
}

输出:

1
中国
感谢支持!