A
Alex Vinokur
Alf P. Steinbach said:* (e-mail address removed):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.
struct Empty {};
C: sizeof(Empty) == 0
C++: sizeof(Empty) > 0
Why doesn't C need a unique address?