No class can be smaller than one, because pointer arithmetic (in particular, the subtraction operator) can be divided by size, and division by zero can be undefined. It is also necessary that each instance has a unique address, which means that each of them must be assigned at least one byte of address space, so the minimum size is again one.
So sizeof (Class1) == 1 , because it is necessary for the content, and sizeof (Class2) == 1 , because it is the minimum allowable.
source share