|
-
July 12th, 2002, 01:30 PM
#1
Class X {} sizeof(X) // = 1 ?
Class X
{
}
Class Y
{
char c;
}
class Z
{
int i;
}
Now:
sizeof(X) // == 1
sizeof(Y) // == 1
sizeof(Z) // == 4
Why is the size of class X is 1 when it is empty ?
I understand that sizeof(Y) & sizeof(Z) to be 1 and 4 because of the member variables.
Can someone enlighten me on this.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|