|
-
July 2nd, 2008, 06:35 AM
#1
find offset fo struct member
How to find offset of struct member
struct
{
int a;
char b[30];
double d;
}
how to find at what possition does b starts or d starts. There is macro offsetof but that is not quite useful if you dont have struct available ie offsetof is not useful foe me. Please give any other way to to find offset.
Problem here is coming because of struct padding and alignment.
Hope you get it..!!
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
|