Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!apple!usc!sdd.hp.com!uakari.primate.wisc.edu!crdgw1!camelback!volpe From: volpe@camelback.crd.ge.com (Christopher R Volpe) Newsgroups: comp.lang.c Subject: Re: Invoking pointers to functions (C sytle) Message-ID: <14436@crdgw1.crd.ge.com> Date: 30 Nov 90 23:58:38 GMT References: <6379@harrier.ukc.ac.uk> Sender: news@crdgw1.crd.ge.com Reply-To: volpe@camelback.crd.ge.com (Christopher R Volpe) Lines: 25 In article <6379@harrier.ukc.ac.uk>, dac@ukc.ac.uk (David Clear) writes: |>main() |>{ |> int fred(), (*p)(); |> |> p = fred; |> |> (*p)(10); /* The right way */ |> p(10); /* This works too */ |>} |>Q: Is p(args) legal, portable C? Yes |>Q: Is p(args) preferential to (*p)(args) as it looks neater, compare: |> s->p(args) (*s->p)(args) I prefer (*p)(args) because the use matches the declaration and doesn't cause me to go running around looking for the prototype declaration of "function p". BTW, (*fred)() is just as legal as fred(). ================== Chris Volpe G.E. Corporate R&D volpecr@crd.ge.com