pointers to functions

Alan J Rosenthal flaps at dgp.toronto.edu
Fri Sep 1 06:57:04 AEST 1989


john at chinet.chi.il.us (John Mundt) writes:
>If f holds the address of the start of the function, *f really doesn't
>have any meaning.  

True, but if f is a pointer to the function, which is what happens in C,
then *f is the function itself, just like if ip is a pointer to an int,
*ip is the int pointed to.  Pointers and addresses are different, and C
only has pointers.  (A pointer cannot be implemented by an address; it
requires additional type information (usually implicit).)

ajr

p.s. I know that pf(x) works, and I know why (followup avoidance tactic).



More information about the Comp.lang.c mailing list