Top posts

Every blog post that took off on Hacker News, ranked by the votes of its best submission. 6,945 posts.

Systems & Performance
Any year
2832

Writing memory efficient C structs

A struct in C is the best way to organize your data so that you can easily use the data later in your program. However, there are a few caveats to C structures, mainly how their memory works. Note that I’m making a lot of assumptions about type sizes and standards. These can differ between systems and ABI’s, so for…