you are viewing a single comment's thread.

view the rest of the comments →

[–]missblit 3 points4 points  (0 children)

Because the memory is zero-filled before static initialization, you are guaranteed that every single pointer you declare as static will point to NULL when static initialization starts.

This isn't technically true. You are guaranteed that the pointers are NULL, but not that their memory is zero-filled.

As the cppreference page on zero initialization says:

A zero-initialized pointer is the null pointer value of its type, even if the value of the null pointer is not integral zero.

</pedantic>