by dropbear3 · 3y ago · 0 comments
#ifdef __cplusplus
# define ZERO_INIT {}
#else
# define ZERO_INIT {0}
#endif
Works for arrays, aggregates, scalars, etc., but I just use it for arrays and aggregates: `char buf[32] = ZERO_INIT; struct X x = ZERO_INIT;`