char32_t、char16_t、wchar_t 用于 c++ 语言里存储 unicode 编码的字符,给出它们的具体定义
(1)
#include <iostream>
#include <string>int main()
{ std::u16string s = u"C++11 引入 char16_t"; // 定义 UTF-16 字符串for (char16_t c : s) // 遍历输出每个 char16_t 的值std::cout << std::hex << (int)c << " ";return 0;
}
(2)
谢谢