2.13.2 - [lex.ccon] - [lexist. Character constant]

xiaoxiao2021-03-06  87

Please don't reprint this article; please don't re-publish this article in any form; please delete it within 24 hours of downloading this article; it is forbidden to use this article for commercial purposes.

2 Lexical Conventions [Lex] 2.13 Literals [lex.literal] 2.13.2 Character Literals [lex.ccon] 2 lexical agreement [lexical] 2.33 text quantity [lexical. Text quantity] 2.3.2 character number [lexical. Character constant] Character-literal: 'c-char-sequence' l'c-char-sequence 'c-char-sequence: c-char c-char-sequence c-char c-char: Any Member of the source character set Except The Single -quote ', backslash /, or new-line character escape-sequence universal-character-name escape-sequence: simple-escape-sequence octal-escape-sequence hexadecimal-escape-sequence simple-escape-sequence: one of /' / "/? // / A / b / f / n / r / t / v octal-escape-sequence: / octal-digit / octal-digit octal-digit / octal-digit octal-digit octal-digit hexadecimal-escape- SEQUENCE: / X Hexadecimal-Digit Hexadecimal-escape-sequence Hexadecimal-Digit Character - Text Quantity: 'C-Character - Sequence' L'C-Character - Sequence 'C-Character - Sequence: C-Character C-Character - Sequence C - Character C-Character: Any character in the source character set, in addition to single quotes', backslash /, or wrap character escape-sequence unified character name escape - sequence: simple-escape-sequence eight-in-one-escape-sequence Hexadecimal - escape - sequence simple - escape - sequence: 1 of the following / '/ "/? // / A / b / f / n / R / T / V octal - escape - Sequence: / Octa - Digital / Octa - Digital Binary - Digital / Octa - Digital Eight - Binary - Digital Eight - Digital - Digital Hexadecimal - Encyclopedia - Sequence: / X Hexadecimal - Digital Hexadecimal - Encyclopedia - Sequence Hexadecimal - Digital a Character Literal Is One or More Characters Enclosed in Single Quotes, AS IN 'X', Optionally Precededed by The Letter L, AS IN L'X '

. A character literal that does not begin with L is an ordinary character literal, also referred to as a narrow-character literal. An ordinary character literal that contains a single c-char has type char, with value equal to the numerical value of the encoding of the c-char in the execution character set. an ordinary character literal that contains more than one c-char is a multicharacter literal. a multicharacter literal has type int and implementation-defined value. character literal is a mono-quoted Or multiple characters, such as' x ', can also follow the letter L, such as L'X'. The character number of the characters without L in front is the amount of normal character, and it is called narrow character. A normal character text containing a single C-character has a type char, which is equal to the coding value of the C-characters in the actuator. Normal characters containing multiple C-characters are multi-character text quantity. The type of multi-character text is int, which is defined by implementation. A Character Literal That Begins with The Letter L, Such As Literal. A Wide-Character Litral. A Wide-Character Literal Has Type Wchar_t.23) The Value of A Wide-Character Litral Containing A Single C-Char HAS Value et as a wide-character set. The value of a wide-character Literal Containing Multiple C-chars is ustementation-defined. The character volume starting with L is wide character. Text quantity, such as L'X '. Wide character text has a type Wchar_t. 23) The value of a wide character text containing a C-character is equal to the coding value of the C-characters in the wide character set. The value of a wide character text containing multiple C-characters is defined by implementation. Certain Nongraphic Characters, The Single Quote ', The Double Quote "

new-lineNL (LF) / nhorizontal tabHT / tvertical tabVT / vbackspaceBS / bcarriage returnCR / rform feedFF / falertBEL / abackslash /// question mark? /? single quote '/' double quote "/" octal numberooo / ooohex numberhhh / xhhh

The double quote "and the question mark?, Can be represented as themselves or by the escape sequences /" and /? Respectively, but the single quote 'and the backslash / shall be represented by the escape sequences /' and // respectively. If The Character Following a BACKSLASH IS NOT One of Those Specified, The Behavior Is Undefined. An escape sequence specifies a single character, single number ', double quotes ", question mark?, And antilactors /, follow Table 5 for explanation. Table 5 - Side sequence

Wrap NL (LF) / N horizontal table HT / T vertical table VT / V retractable BS / B Enter CR / R change page FF / F alert BEL / A anti-slope /// question mark? /? Single quotes' / 'Double Quotation Number / "Octa Numeric OOO / OOO Sixteen Binary Numerical HHH / XHHH

Double quotation marks "and question mark? You can represent itself, or use escape sequences /" and /? Represents, but single quotes 'and anti-laminated / should be represented by the escape sequence /' and //. If the characters behind the backlash are not specified, their behavior is undefined. A escape sequence represents a single character. The escape / ooo consists of the backslash followed by one, two, or three octal digits that are taken to specify the value of the desired character. The escape / xhhh consists of the backslash followed by x followed by one or more hexadecimal digits that are taken to specify the value of the desired character. There is no limit to the number of digits in a hexadecimal sequence. A sequence of octal or hexadecimal digits is terminated by the first character that is not an octal digit or a hexadecimal digit, respectively. The value of a character Literal IS Implementation-Defined if it falls outside of the importerse - defined Range defined for char (for ordinary Litrals) or wchar_t (for Wide Litrals). Follow one, two or three octaves The escape sequence / OOO composed of numbers is used to represent the value of the character specified. The escape sequence / XHHH composed of one or more hexadecimal numbers is followed by the reverse slope. It is used to represent the value of the character specified. The number of numbers of the hexadecimal sequence is not limited. Octa or hexadecimal digital sequences ends when encountering characters that are not eight-binary or hexadecimal numbers. When the value of the character character exceeds the value defined by the implementation of the CHAR (for a normal text quantity) or WCHAR_T, its value is defined by the implementation.

转载请注明原文地址:https://www.9cbs.com/read-98268.html

New Post(0)