home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / c / 16796 < prev    next >
Encoding:
Text File  |  1992-11-19  |  1.2 KB  |  42 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!cs.utexas.edu!wupost!darwin.sura.net!Sirius.dfn.de!math.fu-berlin.de!hamel!rene
  3. From: rene@hamel.uucp (Rene Mueller)
  4. Subject: Re: pointers to functions
  5. Message-ID: <DU28YHO@math.fu-berlin.de>
  6. Keywords: pointers functions parameters
  7. Sender: rene@hamel (Rene Mueller)
  8. Organization: Free University of Berlin, Germany
  9. References: <1dej8fINNq9i@agate.berkeley.edu> <mwm.2k0j@contessa.palo-alto.ca.us> <1992Nov6.234729.13866@koko.csustan.edu>
  10. Distribution: na
  11. Date: Thu, 19 Nov 1992 17:36:48 GMT
  12. Lines: 28
  13.  
  14. In article <1992Nov6.234729.13866@koko.csustan.edu>, pendell@deneb.csustan.edu (Brian Pendell) writes:
  15. |> Greetings!
  16. |> 
  17. |> As many of you already know, the declaration
  18. |> 
  19. |> double (*pfun) ();
  20. |> 
  21. |> declares pfun to be a pointer to a function which returns double.
  22. |> 
  23. |> Now, how do I call the function using the pointer? That is, the next
  24. |> 
  25. |> instruction should be:
  26. |> 
  27. |> "Call the function pointed to by pfun with parameters A and B"
  28. |> 
  29. |> function (A,B), in other words.
  30. |> 
  31. |> Any suggestion?
  32. |> 
  33. |> 
  34. |>     -- Brian Pendell (pendell@ceti.csustan.edu)
  35.  
  36. the same way you reference EVERY pointer:
  37. (*pfun)(paramlist);
  38. you must write (*pfun)() cause funktion calling has a higher priority than
  39. dereferencing pointers...
  40.  
  41.     Rene
  42.