Above is the alignment of class A and that's why the size of the class is 8 Bytes. Static data members and member functions have no contribution.How compiler adds padding?Now the question is how compiler adds p
Above is the alignment of the structureA, and that's why thesize of the struct is 32 Bytes. Also, the objectaof type structAis 32 Bytes. How compiler adds padding? Now the question is how compiler adds padding and align? The method is compiler dependent and kind of greedy. It aligns ...