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.
Learn C the Hard Way: Practical Exercises on the Computational Subjects You Keep Avoiding (Like C) (Zed Shaw's Hard Way Series) 1st Edition
You Will Learn C!
Zed Shaw has crafted the perfect course for the beginning C programmer eager to advance their skills in any language. Follow it and you will learn the many skills early and junior programmers need to succeed–just like the hundreds of thousands of programmers Zed has taught to date! You bring discipline, commitment, persistence, and experience with any programming language; the author supplies everything else.
In Learn C the Hard Way, you’ll learn C by working through 52 brilliantly crafted exercises. Watch Zed Shaw’s teaching video and read the exercise. Type his code precisely. (No copying and pasting!) Fix your mistakes. Watch the programs run. As you do, you’ll learn what good, modern C programs look like; how to think more effectively about code; and how to find and fix mistakes far more efficiently. Most importantly, you’ll master rigorous defensive programming techniques, so you can use any language to create software that protects itself from malicious activity and defects.
Through practical projects you’ll apply what you learn to build confidence in your new skills. Shaw teaches the key skills you need to start writing excellent C software, including
- Setting up a C environment
- Basic syntax and idioms
- Compilation, make files, and linkers
- Operators, variables, and data types
- Program control
- Arrays and strings
- Functions, pointers, and structs
- Memory allocation
- I/O and files
- Libraries
- Data structures, including linked lists, sort, and search
- Stacks and queues
- Debugging, defensive coding, and automated testing
- Fixing stack overflows, illegal memory access, and more
- Breaking and hacking your own C code
It’ll Be Hard at First. But Soon, You’ll Just Get It–And That Will Feel Great!
This tutorial will reward you for every minute you put into it. Soon, you’ll know one of the world’s most powerful programming languages. You’ll be a C programmer.
Watch Zed, too! The accompanying DVD contains 5+ hours of passionate, powerful teaching: a complete C video course! If you purchase the digital edition, be sure to read "Where Are the Companion Content Files" at the end of the eBook to learn how to access the videos.
- ISBN-100321884922
- ISBN-13978-0321884923
- Edition1st
- PublisherAddison-Wesley Professional
- Publication dateSeptember 4, 2015
- LanguageEnglish
- Dimensions7 x 0.78 x 9.1 inches
- Print length384 pages
Deals on related products
Customers also bought or read
- Learn Python the Hard Way (Zed Shaw's Hard Way Series)
Paperback$39.34$39.34FREE delivery Wed, Apr 29 - C Programming Language, 2nd Edition#1 Best SellerC Programming Language
Paperback$60.30$60.30FREE delivery Wed, Apr 29 - Writing a C Compiler: Build a Real Programming Language from Scratch
Paperback$42.43$42.43FREE delivery Wed, Apr 29 - Structure and Interpretation of Computer Programs - 2nd Edition (MIT Electrical Engineering and Computer Science)
Paperback$59.90$59.90FREE delivery May 9 - 12 - The Pragmatic Programmer: Your Journey To Mastery, 20th Anniversary Edition (2nd Edition)#1 Best SellerSoftware Design & Engineering
Hardcover$41.64$41.64FREE delivery Wed, Apr 29 - Code: The Hidden Language of Computer Hardware and Software
Paperback$33.12$33.12Delivery Wed, Apr 29 - Beej's Guide to Network Programming: Using Internet Sockets
Paperback$19.99$19.99Delivery Wed, Apr 29 - Understanding and Using C Pointers: Core Techniques for Memory Management
Paperback$33.99$33.99Delivery Wed, Apr 29 - Algorithmic Thinking, 2nd Edition: Learn Algorithms to Level Up Your Coding Skills
Paperback$32.49$32.49Delivery Wed, Apr 29 - Tour of C++, A (C++ In-Depth Series)#1 Best SellerC++ Programming Language
Paperback$39.99$39.99FREE delivery Wed, Apr 29 - Rust for Rustaceans: Idiomatic Programming for Experienced Developers
Paperback$29.49$29.49Delivery Wed, Apr 29 - Command-Line Rust: A Project-Based Primer for Writing Rust CLIs
Paperback$40.02$40.02FREE delivery Wed, Apr 29 - Operating Systems: Three Easy Pieces#1 Best SellerComputer Operating Systems Theory
Paperback$28.27$28.27Delivery Wed, Apr 29 - Effective C, 2nd Edition: An Introduction to Professional C Programming
Paperback$27.88$27.88Delivery Wed, Apr 29 - Design Patterns: Elements of Reusable Object-Oriented Software#1 Best SellerObject-Oriented Design
Hardcover$31.92$31.92Delivery May 7 - 13 - Bare-Metal Embedded C Programming: Develop high-performance embedded systems with C for Arm microcontrollers#1 Best SellerComputer Hardware Embedded Systems
Paperback$33.59$33.59Delivery Wed, Apr 29 - The Elements of Computing Systems, second edition: Building a Modern Computer from First Principles
Paperback$40.38$40.38FREE delivery Wed, Apr 29 - Automate the Boring Stuff with Python, 2nd Edition: Practical Programming for Total Beginners
Paperback$22.67$22.67Delivery May 5 - 11 - Hands-On Network Programming with C: Learn socket programming in C and write secure and optimized network code
Paperback$41.21$41.21FREE delivery Wed, Apr 29 - Black Hat Python, 2nd Edition: Python Programming for Hackers and Pentesters
Paperback$29.94$29.94Delivery Wed, Apr 29 - Game Boy Coding Adventure: Learn Assembly and Master the Original 8-Bit Handheld
Paperback$29.48$29.48Delivery Wed, Apr 29 - Natural Language Processing with Transformers, Revised Edition
Paperback$41.60$41.60FREE delivery Wed, Apr 29 - AI Systems Performance Engineering: Optimizing Model Training and Inference Workloads with GPUs, CUDA, and PyTorch
Paperback$71.18$71.18$3.99 delivery May 7 - 12 - Learn to Code by Solving Problems: A Python Programming Primer
Paperback$23.50$23.50Delivery Wed, Apr 29
From the Publisher
Editorial Reviews
About the Author
Zed Shaw is an avid guitar player, programmer, and writer whose books teach people all over the world how to write software. His books Learn Python the Hard Way and Learn Ruby the Hard Way (both now in their third editions) have been read by millions of people around the world. His software has been used by many large and small companies. His essays are often quoted and read by members of many geek communities. An entertaining and lively writer, he will keep you laughing and make you think.
Product details
- Publisher : Addison-Wesley Professional
- Publication date : September 4, 2015
- Edition : 1st
- Language : English
- Print length : 384 pages
- ISBN-10 : 0321884922
- ISBN-13 : 978-0321884923
- Item Weight : 1 pounds
- Dimensions : 7 x 0.78 x 9.1 inches
- Best Sellers Rank: #1,265,196 in Books (See Top 100 in Books)
- #111 in C Programming Language
- #598 in Introductory & Beginning Programming
- #1,015 in Computer Programming Languages
- Customer Reviews:
About the author

Zed Shaw is an avid guitar player, programmer, and writer whose books teach people all over the world how to write software. His book Learn Python the Hard Way has been read by millions of people around the world. His software has been used by many large and small companies. His essays are often quoted and read by members of many geek communities. He is an entertaining and lively writer, who is sure to keep you laughing and make you think.
Related products with free delivery on eligible orders
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
Generated from the text of customer reviewsSelect to learn more
Reviews with images
Kindle version incomplete
Top reviews from the United States
There was a problem filtering reviews. Please reload the page.
- Reviewed in the United States on January 2, 2018Format: PaperbackVerified PurchaseI attempted to learn C years ago, but the tedious nature of pointers, memory management, and most importantly, the unawareness of the tools needed to competently develop in C (ie. Valgrind) kept me away from it for a long time. But in order to be a competent programmer, you really need to be able to understand C, even if you don't develop in it often. It is the language of all system calls and libraries on any Unix variant (Linux, BSD, Mac) that your "scripting" language links to. Even Windows has essential system calls (Win32 or Win 64) that export an interface to C. C is everywhere. You need to be able to at least read C code, and understand what is going at a basic level, and how higher level, garbage collected languages relate to C. For better or worse, C code will continue to be around a very long time.
Zed Shaw's course is like having a mentor guide you through not just the language, but the modern C development environment. Included are
tips on what tools to use, and traps for the naive.
This book, by no means, should be your only C book. This book is for you if you have modest programming experience in a high level, garbage collected language on a Unix-like system (ie. Python, Perl, Ruby, etc.), and need to learn how to speed up parts of the program by writing in C. Given the audience it is written for, certain things are oversimplified. But that does not mean the book is bad.
On the contrary, it is likely the best introductory book for new C programmers. If you are a kernel hacker who has dreams that correctly compile, you are likely to be disappointed.
Some caution about getting a used copy: make sure you get one that has the DVD, as it has info not contained in the text. They supplement each other, and the book isn't nearly as useful without it.
Other texts worth study (after this) include: 21st Century C: C Tips from the New School and Practical C Programming: Why Does 2+2 = 5986? (Nutshell Handbooks)
- Reviewed in the United States on March 13, 2016Format: KindleVerified PurchaseHere is why I love this book :
I've been a .NET developer for 5 years with forgotten knowledge about C and C++. Wanting to get back into writing native code, this book has been amazing. Will you learn to program? No!. Is there theory and university lecture babble? No! This book hits you hard with exact knowledge an experienced developer needs to learn extremely quickly how to write solid C code. Leave your IDE behind, open notepad or similar and forget everything you've learned. The book takes you through using command compiling, Make and Gdb. If you have CL experience, it directly translates to Visual Studio and ms compilers as well. Getting started with the compiler might be the hardest part if you've never done it before. . It teaches hard concepts in very simple steps with rock solid and simple examples. The book has accompanying videos, each about 15 minutes long that help solidify what you just learned. After about two days of real focus, I can finally write c like a champ, or at least somebody who has been doing it for a few years professionally. I recommend this book to anyone who has a few years serious development under his/her belt and wants to learn what C coding is. If you haven't written a line of code before, this book will be tough.
- Reviewed in the United States on August 7, 2016Format: PaperbackVerified PurchaseThis is a darn good intro to C as well as some of the general programming topics that are typically neglected in an introductory book. Of course the author intends this for someone who has previously learned some language previously, so it's not quite a raw beginner's book. The approach, commensurate with the title, puts a lot of the onus on the reader, but doing so forces you to begin making use of the same resources you're going to use after you've finished the book. "Teaching a man to fish" so to speak. In addition to introducing the C language, the author introduces a number of tools you should become comfortable with and gives you enough information to use the tools without subverting the course into one on any specific tool. This book is much more practical than almost any introductory course I've read.
If you search around the internet, you'll find a lot of recommendations for this book and some criticism, some of it pretty harsh. Having read at least the most prominent of the critical reviews I will warn you that most of them are clearly based on a review of the author's website, where a 'beta' version of the book exists (more on that in a minute), and they didn't bother to read the explanation of the teaching approach.
If you've visited the "Learn C The Hard Way" site, you've seen the foundations for this book, but you have not seen this book! The author does himself a disservice by not updating the site, or making clear that the book is substantially better. Then there are the videos. The book comes with a DVD and 56 videos that are easily the best part. The demonstrations can go a little quick, but the explanations and additions are fantastic, and the kind of thing you just won't find elsewhere.
So a lot of the critiques go something like "OMG, the author tells you to use "Make" but doesn't regurgitate the entire Make manual before telling you to use it!" That's true. But also very beneficial. You can learn a bazillion new tricks in Make later, but the author does give you enough to do what you need to do without burying you in a bunch of nuance that won't matter until you're much, much further down the road.
This book is also up-to-date. It might not have this month's popular library, but at least it's moved well into the newer C standards rather than dwelling on C89 which is now two standards out of date.
So, that's all pretty glowing, and as I said starting out, I really like the book. However, it is valid criticism that it could benefit from some more editing. There are references that weren't adjusted transitioning from the beta version on the site. E.g. in the chapter on debug macros, the text says something to the effect that you've already used .h files, when the book hasn't introduced them yet. In another place there's a reminder (for the author) that says something like "add some more explanation about ..." (I don't recall what it was). I didn't find any show stoppers, but it does take some of the polish off the book. A good follow on to this book is "21st Century C" which is in the same vein, but assumes you're a reasonably competent C programmer.
It's worth noting the cost versus value of this book as well. I found this book to be much better than many books costing 2-4 times as much.
If I could do half stars, I'd have given "Learn C the Hard Way" 4.5. The more I look at other learning C texts, the more I like it. While it's not perfect I can think of no book I would recommend more to someone with some programming experience, but new (or new-ish) to C.
Top reviews from other countries
Alexander KornishevReviewed in Canada on October 28, 20165.0 out of 5 stars It is excellent book! It will take you on really painful ...
Format: PaperbackVerified PurchaseIt is excellent book! It will take you on really painful journey but it will be worth every bit of it. This book will not teach you basics of C, instead it will teach you how real-life programming in C is done. You will spend a lot of time outside of this book looking for resources and finding information. I think it is by design because that's how you will have to do when writing programs on your own. Some readers complained about it, I think it is one of the most useful features of this book: to push you out of comfortable zone and make you work hard. Personally I do not think it should be your 1st book on C, probably more like advanced course after you know basics.
-
VincentReviewed in France on August 25, 20185.0 out of 5 stars Apprendre à la maison
Format: PaperbackVerified Purchasesi vous ne connaissez rien du sujet au début du livre, après avoir lu ce livre vous serez presque incollable.
-
ZweilindtReviewed in Germany on March 30, 20165.0 out of 5 stars Eine Überraschung unter den C-Büchern
Format: KindleVerified PurchaseDie Herangehensweise des Werkes ist äußerst interessant: Es kommt als e-Book (oder Buch) daher - und enthält zusätzlich Videolektionen, die (fast) jedes Kapitel begleiten. Hört man die Stimme des Autoren, so kann man seinen Humor recht gut verstehen, den er im Buch an den Tag legt.
Die verwendete Lernmethode ist besonders zugänglich für jene Personen, die nicht mehr im Lernbetrieb verhaftet sind - und quasi das Lernen noch einmal erlernen müssen.
Das Buch vermittelt nicht nur das Erlernen der Programmiersprache C, es vermittelt vielmehr auch, wie man mit C programmiert, sondern wie man Fehler in eigenen Quellcodes erkennt, findet, man lernt C-Quellcode zu bauen und abzureissen. Der Debugger und Make werden hier ebenso angesprochen, wie den Umgang mit Hilfsmitteln wie Debugger, Make.
Ist man sicher genug, die Grundzüge von C anwenden zu können, geht Zed weiter, er führt dahin, wo die meisten C-Bücher bereits stehenbleiben. Er zeigt auf, wie man Bibliotheken verwendet, automatisiert teste, mit den Bereichen des "undefinierten Verhaltens" umgeht, führt in Algorithmen anhand von doppelt verbundenen Listen, dynamischen Feldern, Sortier- und Suchfunktionen. Es werden sichere Strings behandelt, Hashmaps und -algorithmen, binäre Suchbäume, Stapel und Warteschlangen, Ringpuffer.
Und wenn wird damit fertig sind, geht es ans Eingemachte, durch Lektionen in Sachen Netzwerkprogrammierung.
Wer die Mühe auf sich nimmt - und dies alles durchgearbeitet hat, sich die Mühe gemacht hat, jeder einzelnen Übung zu folgen, der wird am Ende des Kurses ein sicheres Standbein in Sachen C erworben haben, einem C, wie es mit den gängigen Compilern möglich ist, nicht dem hypothetischen C11-Standard, der von keinem einzigen Compiler-Bauer umgesetzt worden ist, das zum jetzigen Zeitpunkt schlichtweg nicht existiert und wohl auch niemals existieren wird. Zed weißt darauf auch bereits zu Anfang seines Werkes hin - und zurecht.
-
Cliente AmazonReviewed in Brazil on March 4, 20195.0 out of 5 stars Ótimo livro vale a pena!
Format: PaperbackVerified PurchaseSe não sabe NADA de C talvez você precise de um livro texto primeiro. Esse livro ensina C mas não do jeito usual. É como aquele professor carrasco que coloca a matéria e diz pra VOCÊ pesquisar. O trabalho faz você pensar e sair do modo: "só olhando" do livro texto e entrar no modo "ralando". E no meu caso, eu já sabia C, mas aprendi lendo um livro escrito por professor universitário. Nem precisa dizer que o código que o autor escrevia era primário e meio teletubbie. Já o autor deste livro o Zed, é um programador profissional com larga experiencia. Aprendi a fazer projetos maiores, a escrever um código mais seguro, organizado, sólido e profissional. Pra mim o livro foi 10.
KBReviewed in the United Kingdom on February 9, 20165.0 out of 5 stars The Not so Hard way to Learn C
Format: PaperbackVerified PurchaseDon't be put off by the title. This book encourages the use of basic text editors or the console to create C programs, as opposed to IDE (Internal Development Environments), with all the protections they offer with pre-compilation warnings and tips. This is what makes it "hard". It will result in you missing typos, forgetting to include libraries and the like. But to some extent this will make you a better programmer, because you will have to find the mistakes yourself.
The book offers a practical approach to learning a language, consisting of a series of tasks which steadily introduce new concepts and methods and increase in difficulty as they are introduced. This allows you to learn best practises which might be lost learning methods and concepts in isolation (not as part of a working program) as you might in other books.
Despite the use of the word hard, I found this book is far easier to learn C from that other books. Including the much recommended 'The C Programming Language' by Kernighan & Ritchie. I found K&R valuable to gain an understanding of the different aspects of C to apply to programming in C. However, I found 'Learn C the Hard Way' much easier to get in to (K&R's latest edition is from 1988) and came away with valuable best practises and more practical C skills.















