home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!cs.utexas.edu!wupost!darwin.sura.net!Sirius.dfn.de!math.fu-berlin.de!hamel!rene
- From: rene@hamel.uucp (Rene Mueller)
- Subject: Re: pointers to functions
- Message-ID: <DU28YHO@math.fu-berlin.de>
- Keywords: pointers functions parameters
- Sender: rene@hamel (Rene Mueller)
- Organization: Free University of Berlin, Germany
- References: <1dej8fINNq9i@agate.berkeley.edu> <mwm.2k0j@contessa.palo-alto.ca.us> <1992Nov6.234729.13866@koko.csustan.edu>
- Distribution: na
- Date: Thu, 19 Nov 1992 17:36:48 GMT
- Lines: 28
-
- In article <1992Nov6.234729.13866@koko.csustan.edu>, pendell@deneb.csustan.edu (Brian Pendell) writes:
- |> Greetings!
- |>
- |> As many of you already know, the declaration
- |>
- |> double (*pfun) ();
- |>
- |> declares pfun to be a pointer to a function which returns double.
- |>
- |> Now, how do I call the function using the pointer? That is, the next
- |>
- |> instruction should be:
- |>
- |> "Call the function pointed to by pfun with parameters A and B"
- |>
- |> function (A,B), in other words.
- |>
- |> Any suggestion?
- |>
- |>
- |> -- Brian Pendell (pendell@ceti.csustan.edu)
-
- the same way you reference EVERY pointer:
- (*pfun)(paramlist);
- you must write (*pfun)() cause funktion calling has a higher priority than
- dereferencing pointers...
-
- Rene
-