Previous Table of Contents "New C Standard" commentary
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 character escape-sequence
A character string literal is a sequence of zero or more
multibyte characters enclosed in double-quotes, as in
A wide string literal is the same, except prefixed by the
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
899 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.
900 If any of the tokens are wide string literal tokens, the resulting multibyte character sequence is treated as a wide string literal;
901 otherwise, it is treated as a character string literal.
902 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)
903 The multibyte character sequence is then used to initialize an array of static storage duration and length just sufficient to contain the sequence.
For character string literals, the array elements have type
for wide string literals, the array elements have type
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
907 The value of a string literal containing a multibyte character or escape sequence not represented in the execution character set is implementation-defined.
908 It is unspecified whether these arrays are distinct provided their elements have the appropriate values.
909 If the program attempts to modify such an array, the behavior is undefined.
910 EXAMPLE This pair of adjacent character string literals
produces a single character string literal containing the two
characters whose values are
Created at: 2008-01-30 02:39:42
The text from WG14/N1256 is copyright © ISO
Created at: 2008-01-30 02:39:42 The text from WG14/N1256 is copyright © ISO