Hi, declaring a struct Table:
struct Tables {
int i;
int vi[10];
Table t1;
Table vt[10];
};
Tables tt;
assuming that a user-deault contructor is defined for Table.
here tt.t1 will be initialized using the default contructor for Table, as well as each element in tt.vt.
On the other hand tt.i and tt.vi are not initialized because those objects are not of a class type.
so we remain with a semi-initialized object tt.
if I understood well - if tt.i or tt.vi won't be explicitly initialized i the code, after creating tt, an error will be thrown if we try to read a value from them?
2) can someone explain it to me, why cpp designers didn't want to simply initialize the built-in types int and int[] to zero?