[comp.lang.c] Double typecast in "offset" macro???

volpe@underdog.crd.ge.com (Christopher R Volpe) (06/06/90)

In the "Answers to Frequently Asked Questions" document,
the structure offset macro is defined as follows:

#define offset(type,mem) ((size_t) (char *)&(((type *)0)->mem))

Now, the "&" operator yields a pointer to the type of "mem".
If you want to convert it to be of type "size_t", why must it
first be converted to "char *" ??  What's wrong with the following:

#define offset(type,mem) ((size_t) &(((type *)0)->mem))

Thanks,
Chris