1975 C Reference Manual by Brian W. Kernighan and Dennis M. Ritchie

1975 C Reference Manual by Brian W. Kernighan and Dennis M. Ritchie

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
- C Reference Manual Dennis M. Ritchie Bell Telephone Laboratories Murray Hill, New Jersey 07974 1. Introduction C is a computer language based on the earlier language B [1]. 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 [2] 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 [3]. 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 [4] 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 [5] 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 [6], is as useful as promised by its title and the author’s previous introductions to allegedly impenetrable sub- jects. 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 operator-pairs. 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. 2.1 Comments The characters / * 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. 2.3 Keywords The following identifiers are reserved for use as keywords, and may not be used otherwise:
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
- C Reference Manual - 2 int break char continue float if double else struct for auto do extern while register switch static case goto default return entry sizeof The entry keyword is not currently implemented by any compiler but is reserved for future use. 2.3 Constants There are several kinds of constants, as follows: 2.3.1 Integer constants An integer constant is a sequence of digits. An integer is taken to be octal if it begins with 0 , decimal otherwise.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/18/2011 for the course COMPUTER S 1111 taught by Professor Name during the Spring '05 term at MIT.

Page1 / 31

1975 C Reference Manual by Brian W. Kernighan and Dennis M. Ritchie

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online