c++中寬字符的處理,一個寬字符佔用兩個字節,實例代碼如下
#include<iostream>
#include<stdlib.h>
#include<locale>
using namespace std;
void main(){
setlocale(LC_ALL, "chs");//設置本地化
wchar_t *p1 = L"www.szu.edu.cn";//賦值使用 wchar_t和 L
wcout << p1 << endl;
wchar_t *p2 = L"深圳大學shenzhenuniversity";
wcout << p2 << endl;
system("pause");
}