Are these 2 structs layout-compatible?
struct One { float x, y, z; }; struct Two { float c[3]; };
Both contains 3 floats, so in a
The compiler is allowed to add padding between members in a class or struct.
class
struct
Array elements are in contiguous locations.
They may not be layout compatible depending on how the compiler organizes the members in the struct.