NULL ROUTINE POINTERS

Joseph S. D. Yao jsdy at hadron.UUCP
Tue Dec 3 15:49:20 AEST 1985


In article <218 at brl-tgr.ARPA> bilbo.niket at locus.ucla.edu (Niket K. Patwardhan) writes:
>I forgot a pair of parenthesis.
>(short (*())) 0

Good: you added a pair of parentheses.  Bad: one fell short.

If I assigned this value to func, then called it, I would have
to say:
	(*func)()
The type that this returns is short.  (Short int, more formally.)
Therefore, I'd have to declare func: short int (*func)() and cast
this (short int (*)()) 0.

Doug already said this, but without explanation.
-- 

	Joe Yao		hadron!jsdy at seismo.{CSS.GOV,ARPA,UUCP}



More information about the Comp.lang.c mailing list