char16_t
suggest changeAn unsigned integer type with the same size and alignment as uint_least16_t
, which is therefore large enough to hold a UTF-16 code unit.
const char16_t message[] = u"你好,世界\n"; // Chinese for "hello, world\n"
std::cout << sizeof(message)/sizeof(char16_t) << "\n"; // prints 7
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents