sizeof struct no less than 1?

Mike none at none.com
Fri Mar 21 19:27:00 PDT 2014


Hello,

Consider an 'empty' struct as follows:

struct Test {}

When printing it's size, it's always 1.
void main()
{
     writeln(Test.sizeof);
}

Output:
1

Why is it not 0?  What about struct Test is consuming 1 byte of 
memory?

Thanks,
Mike


More information about the Digitalmars-d-learn mailing list