sizeof a struc field

Dr. T. Andrews tanner at cdis-1.uucp
Tue Oct 10 00:06:39 AEST 1989


In article <11227 at smoke.BRL.MIL>, gwyn at smoke.BRL.MIL (Doug Gwyn) writes:
)) ... WHY (((type *)0)->anything) is disallowed in the context
)) of compile-time expressions.
) Because (type *)0 is SYNTACTICALLY a null pointer, and there is a
) prohibition against using a null pointer as the left operand of ->.

It is begging the question to say that "it is disallowed because it
is prohibited".  The sizeof() operator is used to extract type
information, and the cited NULL pointer happens to come complete
with all of the required type information.
-- 
Cutting half of passenger service | {bpa,uunet}!cdin-1!cdis-1!tanner
Mulroney: "cold froze our brains" | {attctc gatech!uflorida}!ki4pv!cdis-1!tanner



More information about the Comp.lang.c mailing list