Best book to learn C?

If you could recommend one book to a total beginner who wants to learn how to program in C, what would it be?

It shouldn’t be microcontroller-specific (more general is better), but it does need to make sense to someone with zero programming experience (in any language).

(Myself, I started with K&R, although I had some experience with BASIC (on the C64 and Apple II), Logo, and shell programming before that.)

18 thoughts on “Best book to learn C?”

    1. Thanks for all of these awesome suggestions. I’m going to print this out and bring it to my local bookstore. If only amazon.com had a retail location in Austin… 😉

  1. O’Reilly’s “Practical C Programming” by Steve Oualline is excellent. Also “C Elements of Style” by the same author. K & R is a good reference but not for a beginner. For the advanced, the bible is “Advanced Programming in the UNIX Environment” by W. Richard Stevens.

    Most important, having fun learning it!

    Gary

  2. Illustrating C by Donald G. Alcock is the best book on C that I have ever read. The book is out of print but you can find used copies on Amazon. Every programming book should be written like this book. The Product Description from Amazon:
    Using his unique formula–original and readable prose combined with graphics and calligraphy–Donald Alcock revolutionizes the teaching of the C programming language. A special feature of the layout of the book is the double-page spread: each one covers a particular topic making the book useful as a reference manual. This revised edition has benefited from many corrections and updates, and has now been printed in a wide-page format for ease of use. This book is an excellent introduction to standard (ANSI) C, and will provide a reference manual for beginning programmers, computer enthusiasts, and students.

  3. Wow! Thank you to everyone who replied!

    I see lots of great suggestions here (and a diverse set: everything from university textbooks to “Dummies” books!)

    I’m going to look at all of these and see if I can find a single book to recommend – or maybe a top three?

  4. My favorite book to learn C is textbook used in several colleges.
    C programing A modern Approach by K.N. King, the second edition came out no too long ago.
    http://knking.com/books/c2/

    It is very easy to understand, has an excellent Q&A section and a lot of exercises, many with solutions in the book’s website.

    If you want to learn C this is the book to help you do it.

  5. I first learned with “teach yourself C in 21 days.” I wouldn’t exactly call it a classic, and it did very little to teach good programming practice/style, but it was slow moving and basic enough for a 5th grader to learn the syntax and fundamentals.

  6. I learned C with “A Book on C” but I’d had years of experience with BASIC at the time I read it. K & R is a fantastic book but I don’t know what it’s like for the absolute beginner. I wish I’d had it as a companion to “A Book on C”.

    Bruce Eckel bundled an introduction to C with “Thinking in C++” and “Thinking in Java”. It looks like it’s available as a flash based tutorial:

    http://mindview.net/CDs/ThinkingInC/beta3.

    I believe it’s based upon his experiences teaching programming classes so it might be worth a look.

  7. The book I used to learn C was C: The Complete Reference by Herbert Schildt some 10 years ago. It’s a very through book and excellent for beginners too.

    I read K&R some years after that and think it’s the best book out there. Just maybe not for beginner programmers.

    Reading the books written by the creators of the languages you are learning is always very enjoyable/instructive. Other very good reading I would recommend is The C++ Programming Language by Stroustrup. C++ focused in this case but also covers C as a subset of C++.

  8. I still got my old copies of “C: The complete reference” and “Teach yourself C” both by Herbert Schildt on my desk.

    K&R is there as well, as is “Understanding Pointers in C” by Yashavant P. Kanetkar which came recommended by a Indian work college.

  9. Believe it or not, C for Dummies vol. 1 and vol. 2 by Dan Gookin was an excellent place for me to start. I was very disappointed that C++ for dummies was written by a completely different author and, in comparison, was a pretty crummy text.

    I had the original editions, I can’t speak for any of the later ones. Volume one has like, a chapter on variables, a chapter on for loops, a chapter on if statements. I think it does functions but pointers have to wait for chapter one of volume two. Of course I can’t find them at the moment, probably they’re packed in a box at the bottom of a closet somewhere.

    http://www.amazon.com/C-Dummies-1-Dan-Gookin/dp/1878058789/ref=sr_1_3?ie=UTF8&s=books&qid=1301917209&sr=8-3

    http://www.amazon.com/C-Dummies-2-Dan-Gookin/dp/156884915X/ref=sr_1_1?ie=UTF8&s=books&qid=1301917443&sr=1-1

  10. The Absolute Beginner’s Guide to C by Greg Perry. It is a good introduction to programming in general, and a “gentler” introduction to C than K&R.

  11. From personal experience trying to tutor others to program, I’ve found K&R to be a terrible book to start with. As a programmer, when we read K&R, we take a lot of general programming concepts for granted and then appreciate the terseness of it.

    Beginners seem to not appreciate this terseness, since they don’t understand what it’s saying.

    As for what book to actually use, I don’t have a good answer to that.

    1. I didn’t mean to imply that K&R was a great book for a beginner, it’s just what I happened to have on hand at the time. I struggled a lot in the beginning but eventually it started making sense. I think I may have had a couple Borland C books around as well.

  12. I learned with K&R but also really like “A Book on C” by Kelley and Pohl. I was programming in Fortran before that so not a complete noob. K&R might be a bit terse for most people.

Leave a Reply to JeffCancel reply