Literals for numbers, characters, and strings
suggest changeRemarks
The 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. 0) or a string (e.g. "C"). Strictly speaking, the standard uses the term constant for integer constants, floating constants, enumeration constants and character constants, reserving the term ‘literal’ for string literals, but this is not common usage.
Literals can have prefixes, suffixes, or both, depending on the kind of constant. An integer constant can combine a base prefix with a length or unsigned suffix, as in 0x1UL. A string literal can have an encoding prefix such as L or u8, but it has no suffix. These extra characters change the constant’s type or representation.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents