A character literal consists of one Unicode character or one escape character within single quotes (apostrophes).
Table 16.8. Character literal
| Production | Syntax | Links |
|---|---|---|
character_literal |
"'" ( Unicode_character | escape_character ) "'"
remark: Unicode_character cannot be | the section called “Character literal” |
Unicode_character | any Unicode_character, like A, B, C, 1, 2, 3, +, -, %, and so on | |
escape_character |
|
Example 16.13. Character literals
'a' // a '7' // 7 ' ' // space '"' // double quote '\'' // single quote '\t' // horizontal tab '\u002f' // ?