Compile-time asserts in C
Asserts are good. Compile-time asserts are even better. Here’s how to define and use them in C.
#ifndef CASSERT
#define CASSERT( exp, name ) typedef int dummy##name [ (exp ) ? 1 : -1 ];
#endif
CASSERT( sizeof(int16_t) == 2, int16_t_is_two_bytes )
c programming
Feb 12 2023

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you: