The C Programming Language
The classic book by Brian Kernighan and Dennis Ritchie, who created C, teaching the language in a short, dense text with exercises throughout. It is for students and developers who want to understand pointers, memory, arrays and the standard library properly, including those who will never write C at work but want to know what higher-level languages hide.
2nd edition, 1988 (ANSI C)
Publisher listing · Sept 2026
4.44/5 (11,436 ratings)
Goodreads · Sept 2026
1978
Goodreads · Sept 2026
Book
Other
Kernighan and Ritchie
Intermediate
around $50
What it covers
The second edition teaches ANSI C in under 300 pages: a quick tutorial introduction, then types and operators, control flow, functions and program structure, pointers and arrays, structures, input and output, and the UNIX system interface, followed by a reference manual and a summary of the standard library. Exercises are spread through every chapter, and many of them are small but real programs.
It is famous for its writing. Explanations are short and precise, and the example programs are models of how to say a lot in a little code.
Why it is still worth reading
Few languages teach you how a computer actually handles memory, and C does it without hiding anything. After working through this book:
- Pointers, addresses and pointer arithmetic become concrete rather than scary.
- You understand the difference between the stack and memory you allocate yourself, and why forgetting to free it matters.
- Strings stop being magic: they are arrays of characters ending in a zero byte.
- You can read the C code behind operating systems, databases and language runtimes.
That foundation pays off in operating systems and systems programming courses, and in understanding performance in any language.
Where it shows its age
The second edition dates from 1988 and describes C89. Later standards (C99, C11, C17 and C23) added features such as declaring variables anywhere, the bool type, fixed-width integer types and better library functions. Some book examples use habits now considered unsafe, especially reading input without checking buffer sizes. Compile with warnings turned on and a modern standard flag, and use sanitisers such as AddressSanitizer to catch memory errors the book assumes you will avoid by care alone.
How to work through it
- Read with a compiler open. Type the examples rather than copying them.
- Do a good share of the exercises; the book is short precisely because the exercises do the teaching.
- Spend extra time on chapter 5 (pointers and arrays). Draw memory diagrams until the examples make sense.
- Keep a modern reference, such as cppreference's C section, open for anything newer than C89.
If you have never programmed before, start with a gentler introduction first. This book assumes you already know what a variable and a loop are.
Common questions
Is it still worth it in 2026? Yes, as a way to understand memory and the machine, and as a model of clear technical writing. It averages 4.44 out of 5 from over 11,000 ratings on Goodreads (September 2026). Just add modern C practices on top.
Is it good for a complete beginner? Usually not. It moves fast and assumes programming experience. Learn basic programming in any language first, or use a gentler C introduction and come back to this.
How long does it take? The text is short, but doing the exercises properly takes several weeks of regular work, with chapter 5 on pointers taking the longest.
Are there solutions to the exercises? Not in the book. A separate answer book exists, and many people publish their solutions online; compare only after trying yourself.
Best for: CS students and self-taught developers who can already program and want a real understanding of memory and how software runs close to the machine.
Ready to start?
Opens on Kernighan and Ritchie in a new tab.
Stuck on something specific?
Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.
Follow along
New writing, resources and project ideas land here first.