2 ms·
If you want your structs to be zero initialized, then you just wouldn't declare default values in the struct declaration, and everything would work as before.
by flohofwoe 4y ago
If you want your structs to be zero initialized, then you just wouldn't declare default values in the struct declaration, and everything would work as before.
Also, once you initialize structs with values somewhere in the code (for instance with designated init), there's a high chance that the compiler will put a copy into the data section anyway, which is then memcpy'ed into the runtime struct (it depends on the compiler and compile options).