Learning C from K&R's "The C Programming Language"

For part of my university Computer Science course we need to learn C. My lecturer recommended K&R's The C Programming Language 2nd Edition. After reading the first few pages it clearly states that the book is not a full guide and might be misleading at times so I'm wondering if I should 'learn' C from this book? (its also quite an old book)

I come from a basic Java background so I understand the basic elements of a program (vars, data types, loops, etc) so looking at the C syntax shouldn't be too much of a shock.


K&R is the standard text to learn C from. It is also considered a standard and you can request K&R standard in certain compilers (eg gcc). There is also a formatting type named after the book. Just use it - it's concise and to the point.

A comment about it's age - the book is not old if you consider C and it's various standards and dialects. I have yet to work on a project which uses C11 (the newest standard) and a lot of companies and projects will explicitly use an old standard in bleeding edge technology (eg c89). Also a lot of companies insist on K&R compatibility and some even insist on K&R code formatting style.

Can I also make sure that you don't think of C as say Python where each version pretty much obsoletes the older version. C and it's standards do not age in the sense that they are standards - you pick one that suits your needs. C89 is as new today (2013) as it was in 89. Don't quote me on this one but I am fairly confident that ansi C (C89) is the most widely used standard and "The C Programming Language" deals namely with ansi C.

Another very good book is "The C Book". I think it is an excellent book but it is even older than K&R.

Have a look here:

http://en.wikipedia.org/wiki/The_C_Programming_Language

http://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html#C-Dialect-Options

http://en.wikipedia.org/wiki/ANSI_C

链接地址: http://www.djcxy.com/p/79164.html

上一篇: GUI架构设计资源?

下一篇: 从K&R的“The C Programming Language”学习C语言