
21st Century C
by Ben Klemens · first published 2012
71mentions
42recommended by
59HN commenters
2012–2024first – last mentioned
71% recommend24% neutral5% critical
Why HN recommends it
Practical guide to modern C (C99/C11) that covers the surrounding toolset, such as makefiles and valgrind, plus pragmatic memory management; suits people returning to C or past the basics.
Summarised by Claude from recommending comments
Affiliate links. As an Amazon Associate I earn from qualifying purchases.








…look at Hanson's C Interfaces and Implementations: Techniques for Creating Reusable Software. That's focused on large projects and APIs, but it will give you a good sense of the "cognitive style" of C. 21st Century C is very opinionated, and it spends a great deal of time talking about tooling, but overall, it's a pretty good orientation to the C ecosystem and more modern idioms and libraries. I might also put in…
on “Ask HN: How do I learn C properly?” ↗One of the greatest non-free books, IMO, is 21st Century C and I cannot recommend it enough. http://shop.oreilly.com/product/0636920033677.do
on “Learn C Programming with Open-Source Books” ↗This is a great list of books - at least, I found the same ones were the most excellent. Also I really learnt a lot from 21st Century C (The author here said they wanted to stick to C89, which is fair enough.) >To read great C code will help tremendously. But then he just gives examples of games I don't know and am not really interested…
on “To become a good C programmer (2011)” ↗C Programming: A Modern Approach, 2nd Edition by King is a good beginner book. 21st Century C by Ben Kelemens is also a good book.
on “Modern C, Second Edition” ↗…Programming Absolute Beginner's Guide by Perry and Miller * C Programming A Modern Approach by King * Programming in C by Kochan * C Primer Plus by Prata * Head First C by Griffiths & Griffiths * 21st Century C by Klemens * Understanding and Using C Pointers by Reese * Expert C Programming - Deep C Secrets by van der Linden
on ““Learn C the Hard Way” is no longer available for free” ↗…historical relic and not the best way to learn the language anymore. I have the ANSI second edition. It's way outdated. If you have some programming language experience already I'd suggest going with 21st Century C by Ben Klemens. There's a decent refresher on the language in the appendix and most of the book spends time talking about all of the things most text books skip over: tooling, debugging, the environment,…
on “Ask HN: Should I use K&R to learn C?” ↗It's been a while since I used C very much, but news like this plus the great new 21st Century C, http://shop.oreilly.com/product/0636920025108.do from Ben Klemens and O'Reilly has me reconsidering that. That book says those who complain the standard doesn't do enough should look at POSIX and libraries…
on “C11: A New C Standard Aiming at Safer Programming” ↗You might look at 21st Century C: C Tips from the New School by Ben Klemens. It's very new (November 2012), and has some really nice stuff in it. It's getting mixed reviews, but I really found it useful (even if I, like others, disagree…
on “A nice, little known C feature: Static array indices in parameter declarations” ↗21st Century C - O'Reilly http://www.amazon.com/21st-Century-Tips-New-School/dp/149190...
on “Ask HN: What are the latest and greatest books on your favorite language?” ↗I've been writing C on and off for 27 years or so and I still enjoyed this book from the list on your stackoverflow link: 21st Century C - Ben Klemens http://www.amazon.com/dp/1449327141/?tag=stackoverfl08-20 You asked about "Modern C" and that caught my eye. Most instructional resources on C focus on facts about C without putting them…
on “Ask HN: Where to go to learn Modern C?” ↗I'd recommend Ben Klemens' excellent book "21st Century C - Tips from the New School" [0]. This book teaches you modern C techniques and, most importantly, the tooling that modern C programmers use (git, autotools, valgrind, etc.) It also covers commonly used…
on “Ask HN: Improve C language skills after K&R?” ↗…Brett Slatkin. Sort of an "N ways to improve your Python." Part of a series edited by Scott Meyers. Getting my C mojo back: I left C/C++ 15 years ago. C++ will likely stay left, but I miss C. +Reading 21st Century C, Ben Klemens. The first half is the development environment, which is great, since there's some new stuff since I left, and lots of stuff I've forgotten or never knew. Rereading Expert C Programming:…
on “Ask HN: Books you read in 2016?” ↗I think this trick comes from Ben Klemens' "21st Century C". If you like this, the book has some other tricks in it you might also like. (One example: you can define generic functions in C11).
on “Facil.io: A micro-framework for C web applications” ↗> Any further advice on C for the 20 teens is also welcome. The book 21st Century C by Ben Clemens is worth a look.
on “Ask HN: Looking for a series on implementing classic Unix tools from scratch” ↗…of the recommended books: Head First C - Griffiths and Griffiths Expert C Programming: Deep C Secrets - Peter van der Linden Modern C - Jens Gustedt C Programming: A Modern Approach - K. N. King 21st Century C: C Tips from the New School - Ben Klemens Understanding and Using C Pointers - Richard Reese C Interfaces and Implementations: Techniques for Creating Reusable Software - David R. Hanson The Standard…
on “Tell HN: C Experts Panel – Ask us anything about C” ↗