若要表示字符,可以使用通用字符名称(UCN)。字符‘’的 Unicode 值为 U + 0444,因此在 C + + 中可以写成‘ u0444’或‘ U0000444’。另外,如果源代码编码支持这个字符,那么您可以直接在源代码中写入它。
// both of these assume that the character can be represented with
// a single char in the execution encoding
char b = '\u0444';
char a = 'ф'; // this line additionally assumes that the source character encoding supports this character