I'm planning to buy a book to learn C Language. Many say K&R is a must-have book for C programmers so I chose it. I see that there are two editions. What are the differences between them?
There may be a few cases where a first edition is preferred for some reason or other, but this is definitely not one of them.
If you want to learn C, the second edition is clearly preferred in this case. The first edition teaches a version of C that's been obsolete for decades. C has maintained enough backward compatibility that most of the code in the first edition will probably still work with a current compiler, but it's definitely not written the way you want to write C code any more.
If memory serves me right, K&R 2nd Edition was published in 1988, to comply with the imminent release of ANSI-C (aka C89)
A lot has happened in the C world since then...
- 1990 - adoption of C by ISO as ISO/IEC 9899:1990 (aka C90)
- 1999 - new revised standard as ISO/IEC 9899:1999 (aka C99)
- 2011 - further major revision as ISO/IEC 9899:2011 (aka C11)
Not to mention the work of MISRA and CERT-C (etc) to produce safer subsets.
I have a copy of both editions, but seldom refer to either...