Nomen Nescio <nobody@dizum.comwrites:
Quote:
What is this?
>
Eric said:
Quote:
>What is this?
>>
>( char * ) &( ( struct aStruct * ) 0 )
>
That looks like either someone's poor coding or someone's poor
pasting for an implementation of offsetof() from stddef.h. The
(char *) leads me to think that there's plenty of missing context,
so post the surrounding code, and we'll be happy to jerk ourselves
off analyzing the code for you and telling you why it won't work on
the control system for your Tomahawk missile.
>
For what it's worth,
>
((size_t) &((TYPE *)0)->MEMBER)
>
is a common implementation of offsetof() on systems that allow it.
>
Yours,
Han from China
"Han from China", or "Nomen Nescio", or whoever you are:
You seem to know C pretty well, and I've seen you make some valid
points. Perhaps if you gave up on the trolling (e.g., post under a
consistent name (it doesn't have to be your real one), don't start a
new thread for every followup, and stop being such an offensive jerk),
you might actually make a valuabe contribution here. It's up to you.
--
Keith Thompson (The_Other_Keith)
kst-u@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"