Micron Document
The C Programming Language, Ansi C


← Prev · 197/277 · Next →

The type of an integer constant depends on its form, value and suffix. (See Par.A.4 for a discussion of types). If it is unsuffixed and decimal, it has the first of these types in which its value can be represented: int, long int, unsigned long int. If it is unsuffixed, octal or hexadecimal, it has the first possible of these types: int, unsigned int, long int, unsigned long int. If it is suffixed by u or U, then unsigned int, unsigned long int. If it is suffixed by l or L, then long int, unsigned long int. If an integer constant is suffixed by UL, it is unsigned long.

The elaboration of the types of integer constants goes considerably beyond
the first edition, which merely caused large integer constants to be

long

. The

U

suffixes are new.

A character constant is a sequence of one or more characters enclosed in
single quotes as in

'x'

. The value of a character constant with only
one character is the numeric value of the character in the machine's
character set at execution time. The value of a multi-character constant is
implementation-defined.

Character constants do not contain the ' character or newlines; in order to represent them, and certain other characters, the following escape sequences may be used:

newline

NL (LF)

n

backslash



\

horizontal tab

HT

t

question mark

?

?

vertical tab

VT

v

single quote

'

'

backspace

BS

b

double quote

"

"

carriage return

CR

r

octal number

ooo

ooo

formfeed

FF

f

hex number

hh

xhh

audible alert

BEL

a