C Reference Manual
Dennis M. Ritchie
Bell Telephone Laboratories
Murray Hill, New Jersey 07974
C is a computer language based on the earlier language B . The languages and their compilers differ in two
major ways: C introduces the notion of types, and defines appropriate extra syntax and semantics; also, C on the
PDP-11 is a true compiler, producing machine code where B produced interpretive code.
Most of the software for the UNIX time-sharing system  is written in C, as is the operating system itself. C is
also available on the HIS 6070 computer at Murray Hill and and on the IBM System/370 at Holmdel . This paper
is a manual only for the C language itself as implemented on the PDP-11. However, hints are given occasionally in
the text of implementation-dependent features.
The UNIX Programmer’s Manual  describes the library routines available to C programs under UNIX, and also
the procedures for compiling programs under that system. ‘‘The GCOS C Library’’ by Lesk and Barres  describes
routines available under that system as well as compilation procedures. Many of these routines, particularly the ones
having to do with I/O, are also provided under UNIX. Finally, ‘‘Programming in C
A Tutorial,’’ by B. W. Ker-
nighan , is as useful as promised by its title and the author’s previous introductions to allegedly impenetrable sub-
2. Lexical conventions
There are six kinds of tokens: identifiers, keywords, constants, strings, expression operators, and other separators.
In general blanks, tabs, newlines, and comments as described below are ignored except as they serve to separate to-
kens. At least one of these characters is required to separate otherwise adjacent identifiers, constants, and certain
If the input stream has been parsed into tokens up to a given character, the next token is taken to include the long-
est string of characters which could possibly constitute a token.
introduce a comment, which terminates with the characters
2.2 Identifiers (Names)
An identifier is a sequence of letters and digits; the first character must be alphabetic. The underscore ‘‘_’’ counts
as alphabetic. Upper and lower case letters are considered different. No more than the first eight characters are sig-
nificant, and only the first seven for external identifiers.
The following identifiers are reserved for use as keywords, and may not be used otherwise: