77 Contributors: 6 Saturday, July 22, 2017
Licensed under: CC-BY-SA
Not affiliated with Stack Overflow
Rip Tutorial:
Roadmap: roadmap

Literals for numbers, characters and strings


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 or suffixes (but not both) which are extra characters that can start or end a literal to change its default type or its representation.

Related Examples