ISBN-10:
0131103628
ISBN-13:
9780131103627
Pub. Date:
04/05/1988
Publisher:
Prentice Hall
C Programming Language / Edition 2

C Programming Language / Edition 2

Current price is , Original price is $67.0. You

Temporarily Out of Stock Online

Please check back later for updated availability.

Product Details

ISBN-13: 9780131103627
Publisher: Prentice Hall
Publication date: 04/05/1988
Series: Software Series
Edition description: REV
Pages: 274
Sales rank: 47,661
Product dimensions: 7.00(w) x 9.20(h) x 0.80(d)

About the Author

Brian W. Kernighan received his BASc from the University of Toronto in 1964 and a PhD in electrical engineering from Princeton in 1969. He was a member of the Computing Science Research center at Bell Labs until 2000, and is now a professor in the Computer Science Department at Princeton. He was a co-creator of several programming languages, including AWK, AMPL, and a number of tools for document preparation. He is the co-author of 10 books and some technical papers, and holds 4

patents. He was elected to the National Academy of Engineering in 2002. His research areas include programming languages, tools and interfaces that make computers easier to use, often for non-specialist users. He is also interested in technology

education for non-technical audiences.

Dennis Ritchie was a computer scientist notable for his influence on ALTRAN, B, BCPL, C, Multics, and Unix.

Read an Excerpt

Preface

Preface

The computing world has undergone a revolution since the publication of The C Programming Language in 1978. Big computers are much bigger, and personal computers have capabilities that rival the mainframes of a decade ago. During this time, C has changed too, although only modestly, and it has spread far beyond its origins as the language of the UNIX operating system.

The growing popularity of C, the changes in the language over the years, and the creation of compilers by groups not involved in its design, combined to demonstrate a need for a more precise and more contemporary definition of the language than the First edition of this book provided. In 1983, the American National Standards Institute (ANSI) established a committee whose goal was to produce "an unambiguous and machine-independent definition of the language C," while still retaining its spirit. The result is the ANSI standard for C.

The standard formalizes constructions that were hinted at but not described in the first edition, particularly structure assignment and enumerations. It provides a new form of function declaration that permits cross-checking of defini-tion with use. It specifies a standard library, with an extensive set of functions for performing input and output, memory management, string manipulation, and similar tasks. It makes precise the behavior of features that were not spelled out in the original definition, and at the same time states explicitly which aspects of the language remain machine-dependent.

This second edition of The C Programming Language describes C as defined by the ANSI standard. Although we have noted the places where thelanguage has evolved, we have chosen to write exclusively in the new form. For the most part, this makes no significant difference; the most visible change is the new form of function declaration and definition. Modern compilers already support most features of the standard.

We have tried to retain the brevity of the first edition. C is not a big language, and it is not well served by a big book. We have improved the exposition of critical features, such as pointers, that are central to C programming. We have refined the original examples, and have added new examples in several chapters. For instance, the treatment of complicated declarations is augmented by programs that convert declarations into words and vice versa. As before, all examples have been tested directly from the text, which is in machine-readable form.

Appendix A, the reference manual, is not the standard, but our attempt to convey the essentials of the standard in a smaller space. It is meant for easy comprehension by programmers, but not as a definition for compiler writersÑ that role properly belongs to the standard itself. Appendix B is a summary of the facilities of the standard library. It too is meant for reference by programmers, not implementers. Appendix C is a concise summary of the changes from the original version.

As we said in the preface to the first edition, C "wears well as one's experience with it grows." With a decade more experience, we still feel that way. We hope that this book will help you to learn C and to use it well.

Brian W. Kernighan, Dennis M. Ritchie

Preface to the First Edition

C is a general-purpose programming language which features economy of expression, modern control flow and data structures, and a rich set of operators. C is not a "very high level" language, nor a "big" one, and is not specialized to any particular area of application. But its absence of restrictions and its generality make it more convenient and effective for many tasks than supposedly more powerful languages.

C was originally designed for and implemented on the UNIX operating sys-tem on the DEC PDP-1 1, by Dennis Ritchie. The operating system, the C compiler, and essentially all UNIX applications programs (including all of the software used to prepare this book) are written in C. Production compilers also exist for several other machines, including the IBM System/370, the Honeywell 6000, and the Interdata 8/32. C is not tied to any particular hardware or system, however, and it is easy to write programs that will run without change on any machine that supports C.

This book is meant to help the reader learn how to program in C. It contains a tutorial introduction to get new users started as soon as possible, separate chapters on each major feature, and a reference manual. Most of the treatment is based on reading, writing and revising examples, rather than on mere statements of rules. For the most part, the examples are complete, real programs, rather than isolated fragments. All examples have been tested directly from the text, which is in machine-readable form. Besides showing how to make effective use of the language, we have also tried where possible to illustrate useful algorithms and principles of good style and sound design.

The book is not an introductory programming manual; it assumes some familiarity with basic programming concepts like variables, assignment statements, loops, and functions. Nonetheless, a novice programmer should be able to read along and pick up the language, although access to a more knowledgeable colleague will help.

In our experience, C has proven to be a pleasant, expressive, and versatile language for a wide variety of programs. It is easy to learn, and it wears well as one's experience with it grows. We hope that this book will help you to use it well.

Brian W. Kernighan, Dennis M. Ritchie

Table of Contents



1. A Tutorial Introduction.


2. Types, Operators, and Expressions.


3. Control Flow.


4. Functions and Program Structure.


5. Pointers and Arrays.


6. Structures.


7. Input and Output.


8. The UNIX System Interface.


Appendix A.


Appendix B.


Appendix C.


Index.

Preface

Preface

The computing world has undergone a revolution since the publication of The C Programming Language in 1978. Big computers are much bigger, and personal computers have capabilities that rival the mainframes of a decade ago. During this time, C has changed too, although only modestly, and it has spread far beyond its origins as the language of the UNIX operating system.

The growing popularity of C, the changes in the language over the years, and the creation of compilers by groups not involved in its design, combined to demonstrate a need for a more precise and more contemporary definition of the language than the First edition of this book provided. In 1983, the American National Standards Institute (ANSI) established a committee whose goal was to produce "an unambiguous and machine-independent definition of the language C," while still retaining its spirit. The result is the ANSI standard for C.

The standard formalizes constructions that were hinted at but not described in the first edition, particularly structure assignment and enumerations. It provides a new form of function declaration that permits cross-checking of defini-tion with use. It specifies a standard library, with an extensive set of functions for performing input and output, memory management, string manipulation, and similar tasks. It makes precise the behavior of features that were not spelled out in the original definition, and at the same time states explicitly which aspects of the language remain machine-dependent.

This second edition of The C Programming Language describes C as defined by the ANSI standard. Although we have noted the places where the language has evolved, we have chosen to write exclusively in the new form. For the most part, this makes no significant difference; the most visible change is the new form of function declaration and definition. Modern compilers already support most features of the standard.

We have tried to retain the brevity of the first edition. C is not a big language, and it is not well served by a big book. We have improved the exposition of critical features, such as pointers, that are central to C programming. We have refined the original examples, and have added new examples in several chapters. For instance, the treatment of complicated declarations is augmented by programs that convert declarations into words and vice versa. As before, all examples have been tested directly from the text, which is in machine-readable form.

Appendix A, the reference manual, is not the standard, but our attempt to convey the essentials of the standard in a smaller space. It is meant for easy comprehension by programmers, but not as a definition for compiler writersÑ that role properly belongs to the standard itself. Appendix B is a summary of the facilities of the standard library. It too is meant for reference by programmers, not implementers. Appendix C is a concise summary of the changes from the original version.

As we said in the preface to the first edition, C "wears well as one's experience with it grows." With a decade more experience, we still feel that way. We hope that this book will help you to learn C and to use it well.

Brian W. Kernighan, Dennis M. Ritchie

Preface to the First Edition

C is a general-purpose programming language which features economy of expression, modern control flow and data structures, and a rich set of operators. C is not a "very high level" language, nor a "big" one, and is not specialized to any particular area of application. But its absence of restrictions and its generality make it more convenient and effective for many tasks than supposedly more powerful languages.

C was originally designed for and implemented on the UNIX operating sys-tem on the DEC PDP-1 1, by Dennis Ritchie. The operating system, the C compiler, and essentially all UNIX applications programs (including all of the software used to prepare this book) are written in C. Production compilers also exist for several other machines, including the IBM System/370, the Honeywell 6000, and the Interdata 8/32. C is not tied to any particular hardware or system, however, and it is easy to write programs that will run without change on any machine that supports C.

This book is meant to help the reader learn how to program in C. It contains a tutorial introduction to get new users started as soon as possible, separate chapters on each major feature, and a reference manual. Most of the treatment is based on reading, writing and revising examples, rather than on mere statements of rules. For the most part, the examples are complete, real programs, rather than isolated fragments. All examples have been tested directly from the text, which is in machine-readable form. Besides showing how to make effective use of the language, we have also tried where possible to illustrate useful algorithms and principles of good style and sound design.

The book is not an introductory programming manual; it assumes some familiarity with basic programming concepts like variables, assignment statements, loops, and functions. Nonetheless, a novice programmer should be able to read along and pick up the language, although access to a more knowledgeable colleague will help.

In our experience, C has proven to be a pleasant, expressive, and versatile language for a wide variety of programs. It is easy to learn, and it wears well as one's experience with it grows. We hope that this book will help you to use it well.

Brian W. Kernighan, Dennis M. Ritchie

Customer Reviews

Most Helpful Customer Reviews

See All Customer Reviews

C Programming Language 4.5 out of 5 based on 0 ratings. 40 reviews.
Guest More than 1 year ago
An excellent book, but definetly _not_ designed for people who have no idea what a compiler is. The book does not teach programming principles; it teaches the syntax. An excellent book if you have some programming background.
Guest More than 1 year ago
After completing reading this book I feel I have a complete 'C' Programming knowledge. I have read lot of other C books, but only after I complete reading this one I'm very confident in C programming. This book will be very good if you have done C programming already but I don't recommend this for beginners.
Guest More than 1 year ago
I'd just like to say that this book was written by the CREATOR of the C programming language, and is essential reference material.
Guest More than 1 year ago
The best way to learn to program in C is to do it from the creators of the language and this book gives you just that. It is not an easy book to read through overnight but can answer almost any question you ever had about C. It is suitable even for absolute beginners who have access to some UNIX environment although it wouldn't teach you in a hand-holding way as some of the other more verbose books on the subject. I recommend it highly both to newcomers and to more experienced people.
jrep on LibraryThing 5 months ago
When men were real men, and small furry creatures from Alpha Centauri ..
vikas on LibraryThing 5 months ago
the only book on C you'll ever need
sirfurboy on LibraryThing 5 months ago
The definitive book of C. Concise and complete. Known simply as "Kernighan and Ritchie" by the entire programming community, this book needs no further recommendation. If you want to program C, you need this book.
acrn on LibraryThing 5 months ago
Absolute classic, must have in every student shelf, even if he isn't that much into C.
amtekdesign on LibraryThing 5 months ago
I own two copies of this book--one for the client site, and one for the home office. If I could only own one book on C, this would be it. Years ago I used this as a tutorial--I still use it as a reference.
mcandre on LibraryThing 5 months ago
Just what a reader would expect: a detailed description of C and stdlib.
billmcn on LibraryThing 8 months ago
With scripting languages replacing C as the easiest entry into the programming world, that big blue-on-white sans-serif C may not be as iconic as it once was, but as a place to get started with the C language there are still no better books than this one. K&R is admirably terse and clear¿it's the Strunk and White of computer programming.
masyukun on LibraryThing 8 months ago
This is a classic in the field and an essential resource for the library of anyone using C or a language derived from C.
szarka on LibraryThing 8 months ago
K&R is the archetype of a programming language book written for programmers. (I'm tempted to say "also for non-programmer UNIX geeks", but in some sense there is no such thing.) For best results, combine this classic with Kernighan's & Pike's The UNIX Programming Environment. [2008-04-26]
bob3000 on LibraryThing 8 months ago
Wonderful. Rare programming book that can be enjoyed away from a terminal^h^h^h^h^h^h^h^hcomputer. Reads as if written by humans -- also rare in this genre.
Anonymous More than 1 year ago
Anonymous More than 1 year ago
C is the language of the gods. This book was written by the gods who created C. This is the C bible. There is no better first language to learn than C and there is no better book on C than this one. Play as you go through this book. You will be glad you did!
Anonymous More than 1 year ago
Anonymous More than 1 year ago
Anonymous More than 1 year ago
Anonymous More than 1 year ago
Anonymous More than 1 year ago
Anonymous More than 1 year ago
Anonymous More than 1 year ago
Anonymous More than 1 year ago
Anonymous More than 1 year ago