(C++) char16\_t
January 9, 2018 · View on GitHub
(C++) char16_t
An char16_t is a keyword that can be used, depending on the standard used:
char16_t in the C++98 standard
char16_t is not supported in C++98:
int main() { char16_t c; //Fails in C++98 }
Compiler output:
/MyFolder/main.cpp:: In function 'int main()': /MyFolder/main.cpp:3: error: 'char16_t' was not declared in this scope /MyFolder/main.cpp:3: error: expected ';' before 'c'
char16_t in the C++11 standard
char16_t is a keyword for a 16-bit character.
int main() { char16_t c; }
Technical note: the code shown is compiled successfully using the G++ 4.4.5 compiler, which is supplied with the Qt Creator 2.0.0 IDE.