Programming Tools Guide
Chapter 3, C language compiler

Constants

Constants

Constants in the C language include:

The first three types, integral constants, floating point constants, and character constants, are explained in this subsection. Enumeration constants are explained in ``Enumerations''. 

Integral constants

Integral constants may be:



Floating point constants





Character constants





Table 3-1 Escape sequences

 new-line          NL (LF)   \n|  audible alert        BEL   \a
 horizontal tab    HT        \t|  question mark        ?     \?
 vertical tab      VT        \v|  double quote         "     \"
 backspace         BS        \b|  octal escape         ooo   \ooo 
 carriage return   CR        \r|  hexadecimal escape   hh    \xhh 
 formfeed          FF        \f|  backslash            \     \\
 single quote      '         \'|
If the character following a backslash is not one of those specified, the compiler issues a warning and treat the backslash-character sequence as the character itself. Thus, '\\q' is treated as 'q'. However, if you represent a character this way, you run the risk that the character may be made into an escape sequence in the future, with unpredictable results. An explicit new-line character is invalid in a character constant and causes an error message.


Wide characters and multibyte characters