C23: nullptr, constexpr, typeof & #embed in C
C23 is the biggest modernization since C99: nullptr ends NULL-macro ambiguity (a real null pointer constant), constexpr brings compile-time constants, typeof enables type-safe generic macros, and #embed includes binary resources as byte arrays at compile time. bool, true, and false are finally keywords β no stdbool.h required.
Also arriving: [[attributes]] with standard spellings ([[deprecated]], [[fallthrough]], [[maybe_unused]]), decimal-free bit-precise _BitInt, and printf %b for binary. Adoption is ramping (GCC 14+/Clang 17+ lead); -std=c23 plus feature checks (__STDC_VERSION__ >= 202311L) gate usage per toolchain.
nullptr ends NULL confusion
A real null-pointer constant with pointer type β no more 0-vs-(void*)0 ambiguity in overload-free C, just clarity.
constexpr and typeof
Compile-time constants plus type queries make generic macros (min/max/clamp) safe without _Generic boilerplate.
#embed resources
static const unsigned char blob[] = { #embed "data.bin" }; β binary assets compiled in, no xxd step.
Gate on versions
#if __STDC_VERSION__ >= 202311L β portable code probes the standard before using its newest words.
#include <stdio.h>Β int main(void) { int *p = nullptr; constexpr int limit = 100; typeof(limit) doubled = limit * 2; printf("%d %d\n", p == nullptr, doubled); 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.