Modern C: C99, C11 & C17 Features
Modern C is friendlier than its reputation, if you opt in with -std=: C99 brought // comments, mixed declarations, stdint.h/stdbool.h, snprintf, and designated initializers; C11 added _Static_assert, _Generic selection, anonymous structs/unions, and threads; C17 fixed defects; C23 adds true bool, constexpr, and typeof.
_Generic deserves special attention — type-based expression selection enabling macro-level generic programming (cbrt-style generic math). The gap that remains is cultural as much as technical: many codebases still target C89 habits long after compilers moved on.
C99 everyday wins
Declarations anywhere, exact-width integers, snprintf, bool, designated initializers — the baseline modern dialect.
C11 checks and generics
_Static_assert validates at compile time; _Generic picks expressions by type — switch-on-type for macros.
Anonymous aggregates
Unnamed struct/union members promote their fields into the parent — terse access without extra names.
Opt in explicitly
-std=c17 (or c23 where supported) plus feature-test macros — never assume the default dialect provides them.
#include <stdio.h> #define typename_of(x) _Generic((x), int: "int", double: "double", default: "other") int main(void) { _Static_assert(sizeof(int) >= 4, "need 32-bit int"); printf("%s\n", typename_of(3.14)); return 0;}Recommended resourcesAffiliate links · may earn us a commission
Recommended for learners
Practice what you learned
Re-implement each visualized algorithm in C yourself — building beats watching.