If I have a structure with an array member and I explicitly call the default constructor of the array in the structure constructor, will the elements be obtained by default? (In the case of an integer array, this would mean getting zero initialization).
struct S { S() : array() {} int array[SIZE]; }; ... S s;
A quick test with gcc suggests that it is, but I wanted to confirm that I can rely on this behavior.
(I noticed that if I did not explicitly build the default array in the constructor of the structure, the elements of the array have random values.)
Highcommander4
source share