home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / c / 13535 < prev    next >
Encoding:
Internet Message Format  |  1992-09-11  |  1.3 KB

  1. Path: sparky!uunet!gatech!prism!xray.gatech.edu!cc100aa
  2. From: cc100aa@xray.gatech.edu (Ray Spalding)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: How to call procedure with a variable?!
  5. Keywords: C VARIABLE PROCEDURE
  6. Message-ID: <68013@hydra.gatech.EDU>
  7. Date: 11 Sep 92 16:15:10 GMT
  8. References: <1992Sep10.143705.15262@galileo.cc.rochester.edu> <67971@hydra.gatech.EDU> <1992Sep11.145441.5720@cbfsb.cb.att.com>
  9. Sender: news@prism.gatech.EDU
  10. Organization: Georgia Institute of Technology
  11. Lines: 17
  12.  
  13. In article <1992Sep11.145441.5720@cbfsb.cb.att.com> edb1@cbnewsf.cb.att.com (edward.benyukhis) writes:
  14. >In article <67971@hydra.gatech.EDU> cc100aa@xray.gatech.edu (Ray Spalding) writes:
  15. >>    t = gotoproc(1,2,3);
  16. >_________________________________
  17. >This is somewhat erroneous.  The way you invoke a function is:
  18. >    t = (*gotoproc)(1,2,3);
  19.  
  20. Harbison & Steel (2nd ed. p. 273) say "In the function invocation
  21. f(...), the expression f may have the type "pointer to function...,"
  22. in which case an automatic dereference of the function pointer is
  23. made in order to perform the call."
  24.  
  25. I believe this is OK per ANSI as well -- anyone know for sure?
  26. -- 
  27. Ray Spalding, Office of Information Technology
  28. Georgia Institute of Technology, Atlanta Georgia, 30332-0715
  29. Internet: ray.spalding@oit.gatech.edu (NeXT Mail accepted)
  30.