"Alf P. Steinbach" <al***@start.nowrote in message news:4k************@individual.net...
* mo********@yahoo.com:struct Empty {};This may be stupid question, but why is sizeof(Base) == 1 in:
int main(int argc, char* argv[])
{
class Base
{
};
cout << sizeof(Base) << endl;
return 0;
}
I guess I want to know what the 1 byte is for? There is no vptr here,
so why 1 byte?I checked FAQ and couldn't find answer.
Needs a unique address.
C: sizeof(Empty) == 0
C++: sizeof(Empty) 0
Why doesn't C need a unique address?
--
Alex Vinokur
email: alex DOT vinokur AT gmail DOT com
http://mathforum.org/library/view/10978.html
http://sourceforge.net/users/alexvn