by Ben Klemens
ISBN: 9781491904428
Buy from O’Reilly
Found in 16 comments on Hacker News
tunnuz · 2022-10-08 · Original thread
I’m not endorsing this as I haven’t read it, but perhaps someone can say if it’s any good for the purpose of learning C from scratch https://www.oreilly.com/library/view/21st-century-c/97814919...
CraigJPerry · 2021-02-28 · Original thread
https://www.oreilly.com/library/view/21st-century-c/97814919...

I thought 21st Century C was good, i've still kept my copy. I'd happily recommend it.

I like the K&R book too - it feels reeeeeeally old but it's really short.

There's a few others that have helped me in various ways but these are a little older -

Love C by Tim Love (free online, my copy is something i just printed out, it's not that long).

Programming from the Ground Up (x86 assembly) - this is available freely online but i bought the book and that helped me a lot with C even though it's a book with only assembly... (to be fair, it does go through calling conventions).

Finally there's another book i love, Advanced Programming in the Unix Environment by Stevens, i have the 6th edition updated by Rago after Stevens' passing. Fascinating book - but huge.

agentultra · 2020-10-28 · Original thread
21st Century C helps a lot [0]. It's not a huge volume but it spends a good amount of it picking out a great tool chain for C projects and how to use them.

[0] https://www.oreilly.com/library/view/21st-century-c/97814919...

yarrel · 2019-01-11 · Original thread
For C:

Pointers, stacks (one in ever 23.7 bugs is a stack smashing bug), bit bashing and endianness, types and coercion at the byte level (see also: pointers, bit bashing), C strings, the stupid rules about when a variable's value is actually written to memory that need to die in a fire, memory allocation/clearing/copying/ownership/freeing, ALWAYS CHECK RETURN CODES, what the heck an lvalue is.

This book is fun:

http://shop.oreilly.com/product/0636920033677.do

bsg75 · 2019-01-08 · Original thread
I have found 21st Century C to be a fairly current treatment: https://www.oreilly.com/library/view/21st-century-c/97814919...
macintux · 2018-06-15 · Original thread
I can't speak to the utility of either, but a couple of resources I've found recently:

http://icube-icps.unistra.fr/img_auth.php/d/db/ModernC.pdf

http://shop.oreilly.com/product/0636920033677.do

tehwalrus · 2018-04-01 · Original thread
Yeah, just return the struct by value.

By the way, if you do C programming and haven't, read 21st Century C:

http://shop.oreilly.com/product/0636920033677.do

fipar · 2018-01-21 · Original thread
I really liked this one: http://shop.oreilly.com/product/0636920033677.do (21st century C, in case the link is wrong as I’m on my phone now)
ZenoArrow · 2017-09-08 · Original thread
> "Nevertheless, I don't think anyone should call themselves a (true) programmer unless they know C."

You could make an even stronger claim about knowing an assembly language. The point being that understanding how a computing device works is helpful in getting the best out of it. If that wasn't your point, then C is no more special than any other popular programming language.

Also, whilst I only know the basics of C, it's pretty clear things have moved on considerably since the days of K&R. It doesn't cover any of the enhancements included in C99 and C11, nor does it cover the tooling and coding conventions (the ones that help avoid problems) that have become commonplace since 1989.

For a more up-to-date reference, I've heard good things about 21st Century C:

http://shop.oreilly.com/product/0636920033677.do

tehwalrus · 2017-03-16 · Original thread
21st Century C is very very good.

http://shop.oreilly.com/product/0636920033677.do

Enjoyable to read through, covers tools as well as the language, and a very good reference of good practise. It covers the basics and then goes into depth on a few of the things C is supposed to be bad at, demonstrating good ways to work (strings, threads, OOP, libraries).

I have a copy on my bookshelf at work, and have been referring to it extensively this week (exposing a C entry point to a C++ world...) It has steered me away from some fairly silly things a couple of times!

It does disagree quite strongly with the article though.

agentultra · 2017-02-06 · Original thread
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

agentultra · 2016-01-08 · Original thread
Nice list!

I like using anonymous structs with variable initializers to provide parameters to functions with default values -- nice and clean!

C99 is not your grandparents' C. It has kept up with the times.

A more thorough resource I cannot recommend highly enough: 21st Century C[0]

[0] http://shop.oreilly.com/product/0636920033677.do

pwaring · 2015-03-17 · Original thread
There's a newer edition available which has been published recently:

http://shop.oreilly.com/product/0636920033677.do