|
⇤ ← 于2007-07-18 22:06:48修订的的版本1
大小: 1282
备注:
|
大小: 1335
备注:
|
| 删除的内容标记成这样。 | 加入的内容标记成这样。 |
| 行号 1: | 行号 1: |
| ## page was renamed from TCPL/A.2.6 String Literals |
A.2.6 String Literals
A string literal, also called a string constant, is a sequence of characters surrounded by double quotes as in "...". A string has type array of characters and storage class static (see Par.A.3 below) and is initialized with the given characters. Whether identical string literals are distinct is implementation-defined, and the behavior of a program that attempts to alter a string literal is undefined. Adjacent string literals are concatenated into a single string. After any concatenation, a null byte \0 is appended to the string so that programs that scan the string can find its end. String literals do not contain newline or double-quote characters; in order to represent them, the same escape sequences as for character constants are available. As with character constants, string literals in an extended character set are written with a preceding L, as in L"...". Wide-character string literals have type array of wchar_t.
- The specification that string literals need not be distinct, and the prohibition against modifying them, are new in the ANSI standard, as is the concatenation of adjacent string literals. Wide-character string literals are new.