Hacker News new | ask | show | jobs
by beefhash 2104 days ago
> Why use C11 over C99?

C11 gives you noreturn and alignas. Alignas can be pretty useful for low-level development in particular. Just hope you don't need variable-length arrays because those got changed to optional.

> Or even why use C99 over C89?

Several very big things: Native bool, stdint.h (fixed-width int types with known sizes ahead of time), long long, snprintf, not having to declare all variables at the top of the block (and now you can do for (size_t i = 0; i < sizeof(strbuf); ++i) because of it).

3 comments

Designated initialisers.
For C99, don't forget // C++ style comments!
snprintf is pretty great for any sort of logging or error messages.