(C++) char32\_t

January 9, 2018 · View on GitHub

 

 

 

 

 

(C++) char32_t

 

An char32_t is a keyword that can be used, depending on the standard used:

 

 

 

 

 

C++98 char32_t in the C++98 standard

 

char32_t is not supported in C++98:

 


int main() {   char32_t c; //Fails in C++98 }

 

Compiler output:

 


/MyFolder/main.cpp:: In function 'int main()': /MyFolder/main.cpp:3: error: 'char32_t' was not declared in this scope /MyFolder/main.cpp:3: error: expected ';' before 'c'

 

 

 

 

 

C++11 char32_t in the C++11 standard

 

 

char32_t is a keyword for a 32-bit character.

 


int main() {   char32_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.