Character literals
A character literal represents a single character, and usually consists of a character in quotes, as in 'a'. character-literal: character: single-character: simple-escape-sequence: one of hexadecimal-escape-sequence: A character that follows a backslash character (\) in a character must be one of the following characters: ', ", \, 0, a, b, f, n, r, t, u, U, x, v. Otherwise, a compile-time error occurs. A hexadecimal escape sequence represents a single Unicode character, with the value formed by the hexadecimal number following “\x”. If the value represented by a character literal is greater than U+FFFF, a compile-time error occurs. A Unicode character escape sequence (§2.4.1) in a character literal must be in the range U+0000 to U+FFFF. A simple escape sequence represents a Unicode character encoding, as described in the table below.
The type of a character-literal is char.
|