The C Programming Language, Ansi C
. Comments do not nest, and they do not occur within a
string or character literals.
An identifier is a sequence of letters and digits. The first character must
be a letter; the underscore
_
counts as a letter. Upper and lower
case letters are different. Identifiers may have any length, and for internal
identifiers, at least the first 31 characters are significant; some
implementations may take more characters significant. Internal identifiers
include preprocessor macro names and all other names that do not have
external linkage (
Par.A.11.2
). Identifiers with external linkage are
more restricted: implementations may make as few as the first six characters
significant, and may ignore case distinctions.
The following identifiers are reserved for the use as keywords, and may not
be used otherwise:
auto double int struct
break else long switch
case enum register typedef
char extern return union
const float short unsigned
continue for signed void
default goto sizeof volatile
do if static while
Some implementations also reserve the words
fortran
and
asm
.
The keywords
const
,
signed
, and
volatile
are new
with the ANSI standard;
enum
and
void
are new since the
first edition, but in common use;
entry
, formerly reserved but never
used, is no longer reserved.
There are several kinds of constants. Each has a data type;
Par.A.4.2
discusses the basic types:
constant:
integer-constant
character-constant
floating-constant
enumeration-constant
An integer constant consisting of a sequence of digits is taken to be octal
if it begins with 0 (digit zero), decimal otherwise. Octal constants do not
contain the digits
8
or
9
. A sequence of digits preceded by
0x
or
0X
(digit zero) is taken to be a hexadecimal integer. The
hexadecimal digits include
a
or
A
through
f
or
F
with
values
10
through
15
.
An integer constant may be suffixed by the letter u or U, to specify that it is unsigned. It may also be suffixed by the letter l or L to specify that it is long.