C ++ 11中字符串文字的Unicode编码
提出一个相关问题之后,我想问一下C ++ 11中新的字符和字符串文字类型。看来我们现在有四种字符和五种字符串文字。字符类型: char a = '\x30'; // character, no semantics wchar_t b = L'\xFFEF'; // wide character, no semantics char16_t c = u'\u00F6'; // 16-bit, assumed UTF16? char32_t d = U'\U0010FFFF'; // 32-bit, assumed UCS-4 和字符串文字: char A[] = "Hello\x0A"; // byte string, "narrow encoding" wchar_t B[] = L"Hell\xF6\x0A"; …