|
-
June 2nd, 2003, 04:10 PM
#1
off set in structure or class size.
How the off set are set while allocating memory.
calss A()
{
public:
char a[10];
char b[2];
float c;
};
calss B()
{
public:
char a[10];
float c;
char b[2];
};
int aa=sizeof(A)// returns 16 bytes
int aa=sizeof(B)// returns 20 bytes
how the offsets are defined in structure and classes.
Thanks.
sanjiv
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
|