Why a C++ Object Is Bigger Than the Sum of Its Members: Alignment, Padding, and Member Order
Three Members Total 11 Bytes, but sizeof Is 24 Start with a simple class: struct Frame { char tag; double value; short code; }; The three members total 11 bytes, yet sizeof(Frame) is 24. Where do the other 13 bytes come …