
Amazon Prime Free Trial
FREE Delivery is available to Prime members. To join, select "Try Amazon Prime and start saving today with FREE Delivery" below the Add to Cart button and confirm your Prime free trial.
Amazon Prime members enjoy:- Cardmembers earn 5% Back at Amazon.com with a Prime Credit Card.
- Unlimited FREE Prime delivery
- Streaming of thousands of movies and TV shows with limited ads on Prime Video.
- A Kindle book to borrow for free each month - with no due dates
- Listen to over 2 million songs and hundreds of playlists
Important: Your credit card will NOT be charged when you start your free trial or if you cancel during the trial period. If you're happy with Amazon Prime, do nothing. At the end of the free trial, your membership will automatically upgrade to a monthly membership.
Buy new:
-7% $65.06$65.06
Ships from: Amazon Sold by: eCampus_
Save with Used - Good
$32.09$32.09
Ships from: Amazon Sold by: Direct via FBA
Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.
Read instantly on your browser with Kindle for Web.
Using your mobile phone camera - scan the code below and download the Kindle app.
Image Unavailable
Color:
-
-
-
- To view this video download Flash Player
Follow the authors
OK
C Programming Language, 2nd Edition 2nd Edition
Purchase options and add-ons
The authors present the complete guide to ANSI standard C language programming. Written by the developers of C, this new version helps readers keep up with the finalized ANSI standard for C while showing how to take advantage of C's rich set of operators, economy of expression, improved control flow, and data structures. The 2/E has been completely rewritten with additional examples and problem sets to clarify the implementation of difficult language constructs. For years, C programmers have let K&R guide them to building well-structured and efficient programs. Now this same help is available to those working with ANSI compilers. Includes detailed coverage of the C language plus the official C language reference manual for at-a-glance help with syntax notation, declarations, ANSI changes, scope rules, and the list goes on and on.
- ISBN-100131103628
- ISBN-13978-0131103627
- Edition2nd
- PublisherPearson
- Publication dateMarch 22, 1988
- LanguageEnglish
- Dimensions6.9 x 0.6 x 9.1 inches
- Print length272 pages
Frequently bought together

Customers who viewed this item also viewed
In C, all variables must be declared before they are used, usually at the beginning of the function before any executable statements.Highlighted by 639 Kindle readers
The main distinction is that in C the called function cannot directly alter a variable in the calling function; it can only alter its private, temporary copy.Highlighted by 453 Kindle readers
We recommend writing only one statement per line, and using blanks around operators to clarify grouping.Highlighted by 424 Kindle readers
From the Publisher
One of the Most Recommended Programming Books of All Time
"It is hard for me to describe just how profoundly that book affected my career. I remember reading it by a campfire in my back yard—my original still smells of smoke—puzzling over the code, and standing to cheer for the concepts. The simple elegance of the writing; the pragmatic outlook of the authors; the sheer beauty of the language thrilled me as no language had before—or has since."
Robert "Uncle Bob" Martin, author of Clean Code.
"K&R is one of my favorite books. The style of the tutorial chapters is so deceptively light and simple and the manual so crisp. Much of C's reputation of simplicity comes from the clarity and great little examples from this book. My 1978 copy has lost its cover and my K&R2 is somewhat dog eared. Above all, K&R is a useful book."
Bjarne Stroustrup, designer and original implementer of C++, and author of The C++ Programming Language
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.
Product details
- Publisher : Pearson; 2nd edition (March 22, 1988)
- Language : English
- Paperback : 272 pages
- ISBN-10 : 0131103628
- ISBN-13 : 978-0131103627
- Item Weight : 1.19 pounds
- Dimensions : 6.9 x 0.6 x 9.1 inches
- Best Sellers Rank: #10,587 in Books (See Top 100 in Books)
- #1 in C Programming Language
- #2 in Computer Programming Languages
- #16 in Computer Software (Books)
- Customer Reviews:
About the authors

Discover more of the author’s books, see similar authors, read book recommendations and more.

Discover more of the author’s books, see similar authors, read book recommendations and more.
Customer reviews
Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.
To calculate the overall star rating and percentage breakdown by star, we don’t use a simple average. Instead, our system considers things like how recent a review is and if the reviewer bought the item on Amazon. It also analyzed reviews to verify trustworthiness.
Learn more how customers reviews work on AmazonCustomers say
Customers find this book informative and useful for learning C programming. They appreciate its concise, plain language that explains the syntax and usage of the language clearly. The book is described as helpful, full of examples, and a handy reference for those who may not use it. Many customers consider it a good value for money and a great seller. They find the content comprehensive and thorough, with a complete table of contents, appendix, and index. The style is described as approachable and straightforward, with plenty of visual representations. However, some readers feel the content is dated.
AI-generated from the text of customer reviews
Customers find the book informative on programming. It teaches an entire programming language in a few lessons with plenty of code examples. The book explains the fundamentals clearly and is organized with well-explained examples. The video tutorials provided by Wibit.net are exceptional.
"...examples are really great to illustrate the concept and some necessary programming skills...." Read more
"...chapters, the appendix follows in an amazingly compact, yet thorough reference, which includes a C grammar, overview of the standard libraries, and..." Read more
"...helped me with logical thinking and having a better understanding of coding closer to the machine has improved me as a developer overall...." Read more
"...It has plenty of code examples for you but it doesn't ever hand you the solution to the problems it challenges you with...." Read more
Customers find the book's language clear and concise. They say it teaches the syntax and usage of C programming language in depth. The book is designed to help readers understand the inner workings of the programming language. Readers mention it guides them to write their own easy programs with well-organized code.
"...The book is very concise, less than 200 pages for the body, but to the point. Neither complicated nor redundant...." Read more
"...qualified, but they communicate very effectively in concise and clear language. The authors do not pander or condescend to readers...." Read more
"...are massive and powerful with HUGE frameworks, but I'm attracted to simple things. This book is a feisty little devil!..." Read more
"...and complete all the challenges then you will have a working knowledge of the C language...." Read more
Customers find the book helpful for students and a handy reference. They appreciate the examples and exercises that help with logical thinking. The book provides basic knowledge and tips for real-world applications.
"...Neither complicated nor redundant. The examples are really great to illustrate the concept and some necessary programming skills...." Read more
"...yet thorough reference, which includes a C grammar, overview of the standard libraries, and more...." Read more
"...Working through these exercises has helped me with logical thinking and having a better understanding of coding closer to the machine has improved..." Read more
"...this book and follow along with all the exercises and complete all the challenges then you will have a working knowledge of the C language...." Read more
Customers find the book offers good value for money. They say it's a great reference for C classes and a good alternative to expensive books.
"...While this book is definitely worth it for anyone interested in Unix-like systems, it's definitely beginning to show it's age...." Read more
"...Don't let the price fool you--The C Programming Language is worth its weight in gold!" Read more
"...In my opinion, going through this book is more valuable than many university class...." Read more
"...Worth the money. Awesome book!" Read more
Customers find the book's content comprehensive and informative. They appreciate its concise and thorough writing style, with a complete table of contents, appendix, and index. The book is well-printed with less than 200 pages for the body, which they consider a suitable length.
"...The book is very concise, less than 200 pages for the body, but to the point. Neither complicated nor redundant...." Read more
"...For such a relatively small text, it's amazing how thorough it is...." Read more
"...Short, easy-to-understand, and right to the point, this books teaches the syntax of C, the usage of C, common paradigms of C, and so on...." Read more
"...The material is described succinctly but also with great thoroughness...." Read more
Customers find the book's style approachable and straightforward. They appreciate the clear, structured screen display and visual representations. The book is described as informative and complete about C.
"...The code examples provided are very helpful and exceptionally elegantly coded...." Read more
"...I have always had an interest in C because I love its simplicity...." Read more
"...one at that from a time when computers were arcane, but the style is very approachable...." Read more
"...Plenty of visual representations with a sense of humor to keep you interested. Straight forward and easy to follow." Read more
Customers have different views on the book's language clarity. Some find it beginner-friendly and straightforward, while others think it's not suitable for absolute beginners and too technical.
"...Neither complicated nor redundant. The examples are really great to illustrate the concept and some necessary programming skills...." Read more
"...Oftentimes, this reference is the most convenient and concise source for information (note that the C Standard is *the*..." Read more
"...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...." Read more
"...That said, the book is quick and relatively approachable...." Read more
Customers find the content dated and archaic at times. They say it's difficult to read, especially with archaic language.
"Great intro book to the C language. It's definitely a bit dated and can be hard to read at times, especially with a few of the examples, but..." Read more
"...for anyone interested in Unix-like systems, it's definitely beginning to show it's age...." Read more
"...I can see that the second edition is much more up to date and much bigger...." Read more
"Great book to learn C Programming from even though it is dated (we are on C11). The information is still relevant and insightful...." Read more
Reviews with images
Worth The Money
Top reviews from the United States
There was a problem filtering reviews right now. Please try again later.
- Reviewed in the United States on November 2, 2024This is by far the best C programming book I've ever read.
I'd like to point out that this is not the no-brain book for beginners with no programming experience at all. You probably need to learn some computer architecture, data structure, algorithms, and other programming experience, even just python.
The book is very concise, less than 200 pages for the body, but to the point. Neither complicated nor redundant. The examples are really great to illustrate the concept and some necessary programming skills.
If you need to get to the hardware closer or learn algorithms further, I would like to recommend this book.
If you are just doing data processing and have no need or interest to algorithm, I wouldn't recommend it. You can start from python or other well encapsulated languages. You can use lots of packages to finish the transaction work.
- Reviewed in the United States on July 12, 2009In 1988, The C Programming Language, 2nd Edition (affectionately referred to as K&R2) was first printed. Despite the passing of so many years, C's syntax and semantics have remained fairly stable. It is then fitting that K&R2 remains the de facto manual and reference for helping programmers get acquainted with the C programming language. Dennis M. Ritchie, one of the co-authors, is the original designer of C and also helped design the Unix operating system in the '60s. Brian Kernighan also helped with the design of Unix, AWK, and is noted for creating other well-known Unix programs.
Not only are the authors well qualified, but they communicate very effectively in concise and clear language. The authors do not pander or condescend to readers. They make no claims to teach C in only one day; they actually expect readers to have a basic grasp on various programming concepts. The authors show an earnest desire to help programmers learn the language. The code examples provided are very helpful and exceptionally elegantly coded. As other reviewers have noted, they help instill good coding habits from the start.
K&R2 provides a helpful introduction to programmers, which gives an overview of what the C programming language is (and is not). The introduction explains C's typing system and basic features. The meat of the book is well organized into chapters that sequentially build upon previous chapters. Chapter 5, "Pointers and Arrays," for example, does a great job at elucidating a difficult computer science concept. A lot of people are well aware of nasty bugs deriving from using pointers and arrays, but the authors explain pointers and arrays in a very clear way, which draws the important distinctions between them.
After the main tutorial chapters, the appendix follows in an amazingly compact, yet thorough reference, which includes a C grammar, overview of the standard libraries, and more. Oftentimes, this reference is the most convenient and concise source for information (note that the C Standard is *the* authoritative source on the C specification). For example, the section covering the "*printf" and "*scanf" conversion specifiers is extremely helpful and much easier to digest than most man pages.
For such a relatively small text, it's amazing how thorough it is. Although it's no substitute for having a copy of the ISO C Standard at hand, it's still an indispensable reference to have. Also, since C99 has yet to be fully implemented on many common implementations, developers still look to the ANSI C standard for ensuring their code is as portable as possible.
I feel K&R2 is the best reference for learning C; it has been considered canon for all these years for a reason.
- Reviewed in the United States on December 17, 2013I'm not new to programming; in fact I've been doing it professionally for the past decade. Although I've played around in quite a few different languages, most of my work over the last 6 years has been in .NET (C# mainly). I have always had an interest in C because I love its simplicity. Also, it's a language which brings one closer to the machine, stripping away many of the abstractions that higher level languages provide. Higher level languages (such as Java, C#, Python, etc.) are massive and powerful with HUGE frameworks, but I'm attracted to simple things.
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.
Top reviews from other countries
LukasReviewed in Canada on August 1, 20245.0 out of 5 stars Awesome book
This is probably the best programming book that I have ever read. The book is concise, intuitive, and packed with information. I wish this would have been my first introduction to programming. Consider not getting the cheaply printed version, the print quality is sad.
Samuel ArenasReviewed in Mexico on May 5, 20245.0 out of 5 stars A must read for all C programmers
Complete book on the basic building blocks of C. Quite simple language but very very powerful.
-
FernandaReviewed in Brazil on June 24, 20235.0 out of 5 stars C
Muito bom. Excelente e importante para quem gosta de programação.
Rashid RashidovReviewed in Germany on December 16, 20245.0 out of 5 stars Just what I wanted
In the age of AI and in general super high level of abstraction in the world of IT, this book is an excellent way to go back to basics and find out how things are working on the relatively low levels of computer systems.
AnushkaReviewed in France on December 3, 20245.0 out of 5 stars Great book
It's THE C book! A must have for all programmers (not really, but it's still great!). If you are just starting your C learning journey, godspeed friend! This book will surely help.










