help with a MESSY C definition!!?

Stephen J. Friedl friedl at vsi.COM
Fri Nov 25 05:54:09 AEST 1988


In article <1506 at buengc.BU.EDU>, bph at buengc.BU.EDU (Blair P. Houghton) writes:
> Now, prove that 
> 
> 	(int *(*)())
> 
> is unambiguously "cast to pointer to function returning pointer
> to int" and never misinterpreted as "cast to function returning pointer
> to pointer to int," whatever the hell that means...

Casts are "abstract declarations".  This means that if you drop the
outer parens, there is exactly one place where a variable name (say,
`foo') could be inserted to make this a real declaration.  Above,
the only place would be:

	int *(*foo)()

So, this is "cast to ptr to function returning ptr to int".

     Steve

-- 
Steve Friedl    V-Systems, Inc.  +1 714 545 6442    3B2-kind-of-guy
friedl at vsi.com     {backbones}!vsi.com!friedl    attmail!vsi!friedl
------------Nancy Reagan on climaxes: "Just say moan!"-------------
:wq!



More information about the Comp.lang.c mailing list