Is it valid to copy a struct some of whose members are not initialized?
I suspect it is undefined behavior, but if so, it makes leaving any uninitialized members in
Since all members of the Data are of primitive types, data2 will get exact "bit-by-bit copy" of the all members of data. So the value of data2.b will be exactly the same as value of the data.b. However, exact value of the data.b cannot be predicted, because you have not initialized it explicitly. It will depend on values of the bytes in the memory region allocated for the data.