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

Constants

Integral constants

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 will issue a warning and treat the backslash-character sequence as the character itself. Thus, '\q' will be 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 will cause an error message.

Wide characters and multibyte characters


Next topic: String literals
Previous topic: Keywords

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004