Firstly, I think you have a misconception about what โintializeโ means.
You see that when the system gives your program memory, it does not bother to clean up after the last program used. That way you can get zeros, you can get seemingly random values, etc.
Now your structures can not benefit from the fact that their data is accidentally installed, right? So, you initialize them: you give your members significant values โโthat make sense for your data. It can be all zeros or not. Initialization, so to speak, sets a meaningful default value .
As for your question, you can use memset() to quickly fill in zero. Hooray! Hope I helped.
memset() : http://www.cplusplus.com/reference/clibrary/cstring/memset/
source share