wchar_t123

来源:互联网 发布:淘宝联盟pc客户端 编辑:程序博客网 时间:2024/05/21 11:36

wchar_t所占字节数目

#include<stdio.h>
#include<iostream>
//#include<wiostream>
using namespace std;
int main()
{
wchar_t c1 = 'xc'; //2 个字节
//wchar_t c1 = "哈"; //error
char16_t c2;
char32_t c3;
printf("%d,%c\n", sizeof(c1), c1);
printf("%d,%d\n", sizeof(c2), sizeof(c3));
cout << c1 << endl;
wcout << c1 << endl;
}
//
2,c
2,4
30819

请按任意键继续. . .

还不会打印

0 0