C guarantees several things about structures:
- The first member of the structure starts at the same address as the structure itself, that is there is no padding before the first member.
- The members of the structure are allocated in the structure in the order of their declaration in the structure definition, they are never rearranged.
- The size of the structure will be greater than or equal to the sum of the sizes of its members, never less. There is another language down the hall where this is not always true.
Post a Comment