address of function

Karl Heuer karl at haddock.ima.isc.com
Thu Jun 15 04:14:49 AEST 1989


As has already been pointed out, my previous article in this thread had a
typo, reversing the names "this" and "foo" in the last paragraph.  I guess
I should have followed my earlier hunch and renamed the variables, thus:

|	int  a[100], (*pa)[100] = &a;
|is analogous to
|	int  f(void), (*pf)(void) = &f;
|This particular symmetry holds only if the explicit "&" is used.  Writing
|"f" without the ampersand yields the same as "&f", but writing "a"
|without the ampersand yields "&a[0]", which is not the same as "&a".
|(Though they will compare equal if brought to a common type.)

Karl W. Z. Heuer (ima!haddock!karl or karl at haddock.isc.com), The Walking Lint



More information about the Comp.lang.c mailing list