10

C99 has been with us for a while now. It introduces a lot of features that are not in K&Rs The C Programming Language. None of them are particularly radical. However, even small features like being able to intermingle declarations and code change how one organizes code.

While I still consider the K&R book an invaluable reference, and like its writing style, is there a better book that takes into account the C99 standard? I'd buy a third edition of K&R in a heartbeat, but I don't think that is going to happen.

3 Answers3

8

You want Harbison and Steele: "C: A Reference Manual"

It explicitly covers C99 and compares/contrasts to other flavors of C. I have found it super useful.

Angelo
  • 1,614
8

I would still suggest (the ANSIfied second edition of) K&R for anyone who is just learning C and who wants to learn Straight Procedural C (minus objects). I'd double that recommendation if they intend to be hacking on *NIX kernel code one day as K&R truly has the "Unix Mentality" in a programming book.

Once they've grasped the basics of C syntax and have a reasonable idea of style you can introduce them to other references that talk about the C99 features and explain that it may change the way they organize what they write, but they'll have (generally) good habits from starting out with K&R (like doing declarations up front) and they'll be cognizant of the why behind doing something contrary to those habits -- I think you build better programmers that way.

voretaq7
  • 341
1

I'd recommend King's C Programming: A Modern Approach. It's thicker than K&R but still not particularly padded and the author points out what is and is not new to C99 as well as style tips and other such things.