int main()
{
typedef struct name
{
long a;
int b;
long c;
} r;
r re = { 3, 7, 5 };
printf("%d", ((unsigned int)&(( struct name *)0)->b));
printf("%d", ((int)&((struct name *)0)->a));
while(1);
}
I find that the program gives the offset of the member of the structure. So, probably similar to offsetof()
. But, This is the first time i am seeing the typecast with '0'
. What does that mean ?