5 ms·
So if you're zeroing out a struct like so struct S {size_t a, void *p;}; foo = (struct S) {0}; Does the standard require the compiler to set any pointers
by paavoova 7y ago
So if you're zeroing out a struct like so
struct S {size_t a, void *p;};
foo = (struct S) {0};
Does the standard require the compiler to set any pointers to NULL, or will everything be implicitly zeroed leaving pointers possibly improperly initialized to NULL?
- loeg 7y agoThe pointers are required to be initialized to NULL in your example (even if the representation is different from memset of zero).
- deleted 7y ago[deleted]
- deleted 7y ago[deleted]