An ordinary character literal that contains a
representable in the execution character
set has type char
, with value equal to the
numerical value of the encoding of the c-char
execution character set.
A multicharacter literal, or an ordinary character literal containing
a single c-char
not representable in the execution
character set, is conditionally-supported, has type int
and has an
The value of a UTF-16 character literal
is equal to its ISO/IEC 10646 code point value,
provided that the code point value is
representable with a single 16-bit code unit.
That is, provided the code point value is in the range
— end note
If the value is not representable
with a single 16-bit code unit, the program is ill-formed.
A UTF-16 character literal
containing multiple c-chars
A wide-character literal has type
The value of a wide-character literal containing a single
has value equal to the numerical value of the encoding
of the c-char
in the execution wide-character set, unless the
has no representation in the execution wide-character set, in which
case the value is
The type wchar_t
is able to
represent all members of the execution wide-character set (see [basic.fundamental]
— end note
of a wide-character literal containing multiple c-chars
Certain non-graphic characters, the single quote '
, the double quote "
the question mark ?
and the backslash
, can be represented according to
The double quote "
and the question mark ?
, can be
represented as themselves or by the escape sequences
the single quote '
and the backslash \
shall be represented by the escape sequences \'
Escape sequences in
which the character following the backslash is not listed in
are conditionally-supported, with
An escape sequence specifies a single
: Escape sequences [tab:lex.ccon.esc]
consists of the backslash followed by one,
two, or three octal digits that are taken to specify the value of the
consists of the backslash followed by x
followed by one or more
hexadecimal digits that are taken to specify the value of the desired
There is no limit to the number of digits in a hexadecimal
A sequence of octal or hexadecimal digits is terminated by the
first character that is not an octal digit or a hexadecimal digit,
If the value of a character-literal
, or U
is outside the range defined for its type,
the program is ill-formed.
— end note