| Start | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Floating point literals Floating point literals are used to represent signed real numbers. The following suffixes can be used to specify type of a literal:
In order to use these suffixes, the literal must be a floating point literal. For example, |
||||||||||||||||||||||||||||||||||||
| Integer literals Integer literals are used to provide integral values. Three numerical bases are supported, indicated by prefixes:
Note that this writing doesn't include any sign, so integer literals are always positive. Something like The type of a decimal integer literal is the first data type that can fit the value from The type of an octal or hexadecimal integer literal is the first data type that can fit the value from Using various suffixes, the default type of a literal can be changed.
The U and L/LL suffixes can be combined in any order and case. It is an error to duplicate suffixes (e.g. provide two |
||||||||||||||||||||||||||||||||||||
| String literals String literals are used to specify arrays of characters. They are sequences of characters enclosed within double quotes (e.g. The Since C11, there are other encoding prefixes, similar to
For the latter two, it can be queried with feature test macros if the encoding is effectively the corresponding UTF encoding. |
||||||||||||||||||||||||||||||||||||
| Character literals Character literals are a special type of integer literals that are used to represent one character. They are enclosed in single quotes, e.g. The When intending to represent certain special characters, such as a character that is non-printing, escape sequences are used. Escape sequences use a sequence of characters that are translated into another character. All escape sequences consist of two or more characters, the first of which is a backslash
A universal character name is a Unicode code point. A universal character name may map to more than one character. The digits When using the line feed escape sequence in text mode I/O, it is converted to the OS-specific newline byte or byte sequence. The question mark escape sequence is used to avoid trigraphs (opens new window). For example, There may be one, two or three octal numerals RemarksThe term literal is commonly used to describe a sequence of characters in a C code that designates a constant value such as a number (e.g. Literals can have prefixes or suffixes (but not both) which are extra characters that can start or end a literal to change its default type or its representation. |
Read Article
https://develop.horje.com/learn/1434/reference