in my code i have three classes
class A
{
protected:
int x;
};
class Bublic A
{
protected :
int y;
};
class Cublic B
{
protected:
int z;
};
in the constructors of each class i cout the sizeof(class)
on console the size is 4 bytes of each class...but as soon i include a char member ...the size of the respective class increases by 4 bytes...though the sizeof(char) is 1 byte.
In help i got it may be due to internal or trailing padding.What are this padding and whats their significance....pls explain me.