DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
C language compiler

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

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


Next topic: String literals
Previous topic: Keywords

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003