sizeof() operator works on the type of the object.So sizeof() operator never reaches runtime. It is computed during compile time itself.
cout<<sizeof(a); // This will print “1” as output.
Null object is an object to a class with no members. To preserve the sanity of the class and object, by default all the cpp compilers will allocate one byte to the empty class. Because there is no point in allocating and deallocating a class with no memory.If we compile sizeof() operator with the empty class object also we will get 1byte as output (because as mentioned earlier it operates on the type of the object).