string-literal: " s-char-sequenceopt " L" s-char-sequenceopt "
s-char-sequence: s-char s-char-sequence s-char
s-char: any member of the source character set except the double-quote" , backslash\\ , or new-line characterescape-sequence
890
A character string literal is a sequence of zero or more
multibyte characters enclosed in double-quotes, as in
891
A wide string literal is the same, except prefixed by the
letter
892
The same considerations apply to each element of the sequence in a
character string literal or a wide string literal as if it were in an
integer character constant or a wide character constant, except that
the single-quote
893 In translation phase 6, the multibyte character sequences specified by any sequence of adjacent character and wide string literal tokens are concatenated into a single multibyte character sequence.
894 If any of the tokens are wide string literal tokens, the resulting multibyte character sequence is treated as a wide string literal;
895 otherwise, it is treated as a character string literal.
896 In translation phase 7, a byte or code of value zero is appended to each multibyte character sequence that results from a string literal or literals.66)
897 The multibyte character sequence is then used to initialize an array of static storage duration and length just sufficient to contain the sequence.
898
For character string literals, the array elements have type
899
for wide string literals, the array elements have type
900
66) A character string literal need not be a string (see 7.1.1),
because a null character may be embedded in it by a
901 The value of a string literal containing a multibyte character or escape sequence not represented in the execution character set is implementation-defined.
902 It is unspecified whether these arrays are distinct provided their elements have the appropriate values.
903 If the program attempts to modify such an array, the behavior is undefined.
904 EXAMPLE This pair of adjacent character string literals
"\x12" "3"
produces a single character string literal containing the two
characters whose values are
905
Forward references:
common definitions
Next
Created at: 2005-06-29 02:18:58
The text from WG14/N1124 is copyright © ISO