Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!purdue!mentor.cc.purdue.edu!pur-ee!hankd From: hankd@pur-ee.UUCP (Hank Dietz) Newsgroups: comp.lang.c Subject: Re: Solution of array of pointers to functions problem Summary: Does ANSI C have an arg type problem here? Message-ID: <11964@pur-ee.UUCP> Date: 16 Jun 89 18:22:33 GMT References: <823@helios.toronto.edu> Reply-To: hankd@pur-ee.UUCP (Hank Dietz) Distribution: na Organization: Purdue University Engineering Computer Network Lines: 15 In article <823@helios.toronto.edu> dooley@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@ee.ecn.purdue.edu