- Amazon Business : For business-only pricing, quantity discounts and FREE Shipping. Register a free business account
C Programming Language, 2nd Edition 2nd Edition
|
Brian W. Kernighan
(Author)
Find all the books, read about the author, and more.
See search results for this author
Are you an author?
Learn about Author Central
|
Use the Amazon App to scan ISBNs and compare prices.
- FREE return shipping at the end of the semester.
- Access codes and supplements are not guaranteed with rentals.
Fulfillment by Amazon (FBA) is a service we offer sellers that lets them store their products in Amazon's fulfillment centers, and we directly pack, ship, and provide customer service for these products. Something we hope you'll especially enjoy: FBA items qualify for FREE Shipping and .
If you're a seller, Fulfillment by Amazon can help you grow your business. Learn more about the program.
Fulfillment by Amazon (FBA) is a service we offer sellers that lets them store their products in Amazon's fulfillment centers, and we directly pack, ship, and provide customer service for these products. Something we hope you'll especially enjoy: FBA items qualify for FREE Shipping and Amazon Prime.
If you're a seller, Fulfillment by Amazon can help you grow your business. Learn more about the program.
![]() |
Enter your mobile number or email address below and we'll send you a link to download the free Kindle App. Then you can start reading Kindle books on your smartphone, tablet, or computer - no Kindle device required.
-
Apple
-
Android
-
Windows Phone
-
Android
|
Download to your computer
|
Kindle Cloud Reader
|
Frequently bought together
Customers who viewed this item also viewed
Special offers and product promotions
Editorial Reviews
Amazon.com Review
From the Publisher
From the Inside Flap
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. RitchiePreface 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
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.
Excerpt. © Reprinted by permission. All rights reserved.
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
Product details
Would you like to tell us about a lower price? If you are a seller for this product, would you like to suggest updates through seller support? |
Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.
Customer reviews
There was a problem filtering reviews right now. Please try again later.
This book is a feisty little devil! I had heard of this book before diving in (it is a classic), but its size and table of contents lead me to believe I would breeze right through it. Wrong! Picking up the syntax wasn't too difficult and I have a fairly good handle on more advanced concepts like pointers already, but this book is absolutely packed with exercises and many of them are quite challenging!
Here's one:
"Write a program to check a C program for syntax errors like unbalanced parenthesis, brackets and braces. Don't forget about quotes, both single and double, escape sequences, and comments."
This is a chapter 1 exercise! Chapter 1 is just a tutorial introduction chapter and this is one 1 of 24 exercises in this chapter! No wonder it takes people years to work through this tiny book. I'm only about halfway through as I write this review.
This book is the perfect blend of reference material, practical knowledge and challenging exercises. There is absolutely no fluff and not a single word is wasted. I grow tired of pouring through 1,000+ page tomes. The appendices are also very well structured and extremely helpful.
Although I do virtually no C coding professionally, I can say for certain that this book has leveled up my skill-set. Working through these exercises has helped me with logical thinking and having a better understanding of coding closer to the machine has improved me as a developer overall. I'm one who believes that this book is great for all programmers, even if you never write a line of C after working through this book. I'm really loving the C language!
Whether you are a beginner or experienced it's worth having this book. Though this will be quite tough for total beginners, I say it's still work picking up and pairing it with a more beginner-friendly book. Unfortunately I cannot recommend such a book at this time because this is the only C book I've worked through.
If you pay attention to the details on this book, you will pick-up the most important area of C that will save you from scratching your head while debugging your code like side effects of infix/postfix increments, precedence of statement evaluation etc..
The authors also discussed some of the best practices in order to optimize the use of language such as efficient manipulation of pointers, style on delaring variables and initializations. Some of the coding style of this book was also used by coding guidelines found in official website of linux kernel.
This book is commendable not only because it was written by the Kernihan and the creator of the language itself(Richie) but how the book was organized and well explained. This is a small book with big information.
I found it to be a great base to ALL other languages I went on to learn - C is like the "father language of the programming world" as many of the pros will tell you.
You can start with this book from absolutely nowhere in C programming, in fact, I think it's better if you do as I felt like I had to "un-learn" many bad habits.
Definitely recommended for everyone by me as it teaches the language to whoever wants to learn C and gives a great base to expand from for anyone who wants to learn other programming languages.
Top international reviews
Approaches of new chapters or topics are to direct that you cant get it.
They could make book more detailed version but their focus is to make it as precise as they can and as for that they made it a non begginer friendly book.
I hope this would help you to choose you a better book than this.
I am rereading the book now because I just bought it for my daughter who just completed her first year of programming classes for college in the States using C++ (amazingly enough) but who will be learning C next year so she can "learn how computers actually work".
It's hard to overstate just how good this book is. It's written by computer scientists who also grok programming, by one of the creators of the language itself. It contains countless useful bits of information you can use as a reference the rest of your life. I used to interview supposed C programmers by asking them the simple question: "Do you know how to implement strcmp or strcpy" and if they had ever read this book, the answer would always be yes. And if you do know how those are implemented, you are well on your way to understanding how computers do what they do, how amazing it all is.
From 35+ years ago I can remember that from this book you will learn how strcmp works, how to write a simple memory allocator, how to implement printf, a beautifully simple implementation of quick sort, and how to write the stdio library, and many others. These things have all helped me be a better than average programmer with a lower average IQ than many of the people I have worked with in Silicon Valley over the years.
It is a beautiful example of concise, accurate writing.
And for me it also brings back incredibly fond memories of my high school years and the excitement that has continued ever since.
This is a good book if you're interested in C, and a great book if you combine that with a strong interest in Linux. Otherwise, you might look elsewhere for a more modern approach to C programming. You won't find much guidance in the way of developing large software projects in C, but playing around and implementing command line tools is all here.
If you want to be an expert I'd definitely recommend this book. This book also gives example programs and tutorials and explains every line it writes, but don't over explain it, as in they come back to some things later on in the book as not to distract from the main thing being taught at the point you are at. This book also tries not to do too much hand holding and gives you exercises to write programs for yourself and lets you figure out some stuff by yourself as it acknowledges that the best way to learn to program is to actually do it rather than just read about it. I haven't ran into any compatibility issues yet meaning that none of the things the books have taught me so far hasn't worked because of the age of the book, all the things I've learnt so far you are still able to apply when coding without running into errors when compiling and running, if you do they're usually minor and can be fixed with a quick google search but its rare when you do. Anyhow this book has a nice clear contents page and references to things like useful libraries and functions you can include when coding, so you can find the section relevant to you if you wish.
This book also has a lot of content to cover so you'll always be learning new things and getting better, it starts of with a nice tutorial introduction to ease you in. Other books I've read on C are usually very very basic and underwhelming and you end up already knowing like 90% of the things taught, whereas this book actually shows you everything. Although don't expect it to constantly hold your hand. If you have a drive for learning and you're determined to write programs this book is definitely for you if you're lazy and want a (Learn programming language in 24hrs or 7days) guide and shortcuts this isn't for you, neither is that even realistic.
I'm definitely gonna stick with this book!
I wish I'd never binned my original copy
Thank you so much.
I feel as though with my understanding of C I am making great leaps with my game development skills.
Dated? Maybe!
The best C Programming tutorial? Maybe / Maybe not!
A Classic IT book? Certainly!
Should it be in your Programming book collection? DEFINITELY!
I believe that NO professional Windows / Unix / Web programmer should be without a copy of this book (or, i believe, a passing knowledge of C) if only to realise what you owe these two guys as far modern programming Languages like Java, C++ and C#, and your career are concerned!
OK, I admit it, I'm a fan!
Would I recommend this book to someone just starting out to learn the basics off programming? Probably not; the book makes no point in hiding that readers should at least know the basic fundamentals of programming before attempting to read this book, and for those readers I would recommend "C All-In-One Desk Reference for Dummies", another truly excellent book on C. But, even for novice readers, it is still significantly better than the majority of other books available, and for slightly more advanced readers completely unbeatable.
There's a reason this book served as the absolute standard on C for many years - the late Dennis Ritchie wrote the language in the first place, not just this book, and I wholeheartedly believe he left behind one of the greatest legacies in Computer Science. If you don't already own this, I can't recommend it highly enough.
In 260 pages the authors explain exactly how C can be used to write powerful but compact programs in a language in which it is possible to do literally anything.
The fact that the book is relatively brief is a huge advantage and is a pleasant change from the enormous volumes currently on offer about C++.
I recommend this book to anyone learning C.
You must own this book in order to be taken seriously as a C programmer.
You've read the top international reviews
Customers who bought this item also bought
There's a problem loading this menu right now.











