Кто-нибудь, подскажите почему адреса не равны?
struct something {
int foo;
char ch;
int bar;
};
int main(void)
{
struct something st;
printf(" st addr: %lx\n", &st);
printf("st addr by foo: %lx\n", (size_t)&st.foo - (size_t)&(((struct something*)0)->foo));
printf("st addr by foo: %lx\n", &st.foo - &(((struct something*)0)->foo));
return 0;
}
Выхлоп:
st addr: 7fff5fbff7e0
st addr by foo: 7fff5fbff7e0
st addr by foo: 1fffd7effdf8