
Helps readers gain a more thorough understanding of C syntax and semantics through puzzles that challenge readers' proficiency with basics. Puzzles are based on ANSI Standard C, and in many cases programs are print statements, so the puzzle solution is the resulting printout. Includes step-by-step solutions. For C programming students at the intermediate level. No index. Annotation copyrighted by Book News, Inc., Portland, OR
Many years ago I did the exercises on the bus in my head, then checking the answers to see what I got wrong and why over the space of a week or so. It's a really, really good resource for anyone learning C. It seemed to work for several first year students who were struggling with C in my tutorials as well and they did great. Can't recommend it highly enough to students and the approach to anyone tempted to write an intro C programming text.
There is problem with the classic introductory book though. "The C Programming Language" is a classic and ppl mention it all the time. But it's horribly outdated and doesn't cover the living language at all. It's more like a description of a language authors wanted C to be, not the real thing.
Take "C Programming: A Modern Approach" or something along the same lines. Go through it, get a hang of the language then follow up with something like "Effective C" or "Modern C", which are good recent mid-level books on the language. I also like "The C Puzzle Book".
Then there's a brilliant "Expert C Programming: Deep C Secrets" explaining subtle details of the language.
One thing that is missing from the books is POSIX. The language itself is very barebones so in practise people are always coding against some Linux/*nix/POSIX or equivalent APIs. These serve as a std library of sorts as otherwise even moderately involved projects become prohibitively big.
Simply Scheme, Structure and Interpretation of Computer Programs, How to Design Programs.
They're a hundred times easier to get going with the exercises using racket than the incredible faff it used to be when purchased, especially with SICP.
Maybe if the book is good enough the wider community supports it?
Then there's K&R C, K&Pike, Richard Stevens, of which any edition from the last 20 years is still pretty useful. Although there must be something better than K&R for C by now - the example programming style can be improved upon while still appreciating its considerable strengths. In that general direction Van Der Linden's "Expert C" and "The C Puzzle Book" remain fantastic books to grok C and low level programming.
The Wrox "Professional Assembly Language" is both out of date (32 bit x86) and still about your best bet, update it and play with the x86-64 abi docs, a download of the intel optimisation manual, "Hackers Delight" and http://aggregate.org/MAGIC/
If you are learning programming (and who among us isn't?), the code examples stink to high heaven. No really. Don't program like that! K&R didn't! If you're learning programming and C it will teach you a bunch of really bad habits /because/ it is a book for experienced programmers with fully developed taste and the examples were designed to illustrate a particular facet of the language as pithily as possible. It's great for that.
I realize any criticism of the sacred texts will result in inspiring revulsion and possibly bile among those who think of such things as above criticism and any commentary is about the shortcomings of the commentator not the holy book but there it is... It's 2022 and I'm old enough to take it. ;-)
Alistair Moffat "Programming, Problem Solving and Abstraction" is one I found that seems better to learn C programming. Maybe other people have better recommendations than that..?
Separate to that "The C Puzzle Book" is superb when you're learning to really thoroughly understand pointers, arrays and so on. Koenig's "C Traps and Pitfalls" isn't bad for some of the dark corners.
For anything C/C++ related, grinding these little puzzles yielded tremendous value for the time spent and removed any lingering questions I had about annoying low level details of the languages for the rest of my career. There are a lot of heady academic books that consume a lot of time, but this one impacts the 80% of time you actually spend at the keyboard.
Stroustroup's "The C++ Programming Language" is eloquently written and surprisingly accessible to beginning/intermediate developers.
1. C: A Reference Manual, by Harbison and Steele. https://www.amazon.com/Reference-Manual-Samuel-P-Harbison/dp...
2. The C Puzzle Book, by Alan Fueur. https://www.amazon.com/Puzzle-Book-Alan-R-Feuer/dp/020160461...
Harbison and Steele has much better explanations than K&R. The Fueur book taught me a lot about C declarations. Declarations are that part of C language that is them most unnecessarily difficult.
You asked about a slightly different question, best practices. But in the real world you'll run into a lot of code that practices below that level.