The book only covers the 1989/1990 version of the C standard. The current standard is from 1999. However, the 1999 version is still not widely used, so the K&R 2nd edition is still highly useful.
Moreover, it's still highly enjoyable.
The book only covers the 1989/1990 version of the C standard. The current standard is from 1999. However, the 1999 version is still not widely used, so the K&R 2nd edition is still highly useful.
Moreover, it's still highly enjoyable.
It covers the C language as standardized by ANSI in 1989. There was an update to the language ('C99') in 1999, although compiler support for it is generally spotty and the original ANSI standard of the language is the safest way to use C in a portable fashion.
I think the latest version of the K&R book was published in 1988. There have been some enhancements to C since then, such as the changes for "C99."
The K&R book is still probably THE resource for C, despite the new additions. Here are a few links that might help point out the new additions:
It covers C89, it is a must read but C99 introduced several new features, many of which had already been implemented as extensions in several compilers and they are widely used:
As others have said, K&R covers C89 (C90), and not C99, but it remains a very good book indeed.
For a detailed view of C99 after reading K&R, use C: A Reference Manual (5th Edition).
I personally have three copies K&R on my shelf, and use them often. It's still the go-to book for a surprisingly wide range of questions.
But it is showing some age. C99 != C89 in several details, but I think the more important differences are in how our style of programming has evolved in the last twenty years. There are standard libraries like glibc to do many of the things that used to be re-implemented and re-re-implemented by C programmers of old. Depending on your situation, you probably don't have to carefully manage every byte of memory, meaning that modern code has a fraction of the malloc()ing that older code had. Changes in focus such as those make some (not all) of K&R look a little obsolete.
For learning modern C, I recommend Modeling with Data, which is available from that link in PDF or from Princeton Press as an actual book. It's primarily about scientific computing, but the first half gives a thorough and reasonably general intro to C from the modern perspective.
If you are looking for latest book on C.
Reference style book: C: A Reference Manual - Samuel P. Harbison and Guy R. Steele
Beginner level book (with detailed explanations): C Programming: A Modern Approach, 2nd Edition - K. N. King