A
aling
Have following code snip:
struct struc {
int member1;
int member2;
} ;
printf("&((struc*)0)->member2=%p\n", &((struc*)0)->member2);
In VC7.1, the output is 4, the offset of member2 in struc.
I wonder why there is no memory access violation for
"((struc*)0)->member2" ?
And why the output is the offset of struc?
what's the output in pure C compiler? I have no C compiler at hand now.
struct struc {
int member1;
int member2;
} ;
printf("&((struc*)0)->member2=%p\n", &((struc*)0)->member2);
In VC7.1, the output is 4, the offset of member2 in struc.
I wonder why there is no memory access violation for
"((struc*)0)->member2" ?
And why the output is the offset of struc?
what's the output in pure C compiler? I have no C compiler at hand now.