Solution of array of pointers to functions problem

Hank Dietz hankd at pur-ee.UUCP
Sat Jun 17 04:22:33 AEST 1989


In article <823 at helios.toronto.edu> dooley at helios.physics.utoronto.ca (Kevin Dooley) writes:
[stuff about making an array of function pointers....]

Hmm.  I never thought about it before, but what does ANSI C do
type-conversion-wise with args to a function accessed via a function pointer
expression?  Unless I'm confused, unlike old C, ANSI C is supposed to make
things be the type you specify in the prototype...  but function pointers
wouldn't have prototypes (or would they?).

For example, suppose that p is a pointer to either a function f which
returns an int and takes a short arg or to function g which returns an int
and takes a long arg...  what is the type, short or long, when the value 5
is passed in code like (*p)(5)?

						-hankd at ee.ecn.purdue.edu



More information about the Comp.lang.c mailing list