Packing of Struct Fields

Per Nordlöw per.nordlow at gmail.com
Fri Oct 16 20:32:22 UTC 2020


Why is `T.sizeof` 12 instead of 8 when `U.sizeof` is 8 in the 
following example?

struct S
{
     int i;
     bool b;
}

struct T
{
     S s;
     char c;
}

struct U
{
     int i;
     bool b;
     char c;
}

?


More information about the Digitalmars-d-learn mailing list