Typeof operator in C (Re: An Interesting View of "Strong" Vs. "Weak" Typing)

Mike Haertel mike at umn-cs.CS.UMN.EDU
Mon Jan 15 10:11:55 AEST 1990


In article <-121H63ggpc2 at ficc.uu.net> peter at ficc.uu.net (Peter da Silva) writes:
>I said... what would typeof() return for some complex structure. This
>being the typeof that returns a first-class object, not the typeof from
>GCC 

>> `struct _T_aaa' or something similar.

>You mean it would return a string? That's an interesting idea. I would have
>expected it to return a small integer of some sort. You know: _T_INT,
>_T_CHAR, _T_DOUBLE.

C has no run-time "type" type.  The type value of a typeof construct
exists only in the mind of the compiler.

-- 
Mike Haertel <mike at ai.mit.edu>
"Everything there is to know about playing the piano can be taught
 in half an hour, I'm convinced of it." -- Glenn Gould



More information about the Comp.lang.c mailing list