Skip to content

Comment on The Lost Art of C Structure Packing

Comments

This is a good article that comes up every so often. If you haven't read it, you should. The art is not quite as lost as advertised, though. A lot of C programmers pack structures that way out of habit.

There's definitely some cases where you shouldn't follow the "biggest to smallest" ordering, but they're usually pretty obvious when you run into them. They usually involve inheritance and such.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.