r/C_Programming
•
u/Kabra___kiiiiiiiid
•
1d ago
•
1
Article Zero-initialisation shenanigans
https://napcakes.nekoweb.org/posts/zero-init/
45
Upvotes
9
u/imaami 1d ago
What about the C23
{}?4
u/cosiekvfj 1d ago
good findings!!!!
2
u/LordRybec 15h ago
Zero initialization makes debugging much more difficult. Better to initialize with an uncommon pattern, so you can search for that pattern when debugging (or see it in buggy output without even having to search), to tell where variables have been created and initialized but not set to their intended value yet. Zeroes are too common to be used like this.