top | item 24492329

(no title)

beefhash | 5 years 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).

discuss

order

masklinn|5 years ago

Designated initialisers.

luke0016|5 years ago

For C99, don't forget // C++ style comments!

marmaduke|5 years ago

snprintf is pretty great for any sort of logging or error messages.