Can anybody tell me why the sizeof() operation on a class having no member gives a size of 1 byte.
Thanks,
hi there,
sizeof()
This operator accepts one parameter, which can be either a type or a variable itself and returns the size in bytes of that type or object:
a = sizeof (char);
This will assign the value 1 to a because char is a one-byte long type.
The value returned by sizeof is a constant, so it is always determined before program execution.
i hope this helps you alot
regards,