I was going through the concept of structure member alignment and structure padding concept when I found that the size of this struct
...
struct nod
The padding and alignment of members of a struct
are completely at the discretion of the compiler, except that there cannot be any padding before the first member. With that said, compilers normally choose padding to serve alignment purposes, so that, in particular,
structs
, if the members of the first array element are aligned optimally then so will be the members of all the others.Subject to those and similar requirements, compilers typically choose the least amount of padding necessary (ideally no padding at all). If different member types have different alignment requirements, then the above considerations require struct
representations to be padded to a multiple of the size of the member with the most stringent alignment requirement. They may also require padding between members, depending on the types of the members and their order.