home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ogicse!das-news.harvard.edu!spdcc!dirtydog.ima.isc.com!karl
- From: karl@ima.isc.com (Karl Heuer)
- Newsgroups: comp.lang.c
- Subject: Re: How to call procedure with a variable?!
- Keywords: C VARIABLE PROCEDURE
- Message-ID: <1992Sep11.224906.5617@ima.isc.com>
- Date: 11 Sep 92 22:49:06 GMT
- Article-I.D.: ima.1992Sep11.224906.5617
- References: <67971@hydra.gatech.EDU> <1992Sep11.145441.5720@cbfsb.cb.att.com> <68013@hydra.gatech.EDU>
- Sender: usenet@ima.isc.com (news)
- Organization: Interactive Systems, Cambridge, MA 02138-5302
- Lines: 15
-
- In article <68013@hydra.gatech.EDU> cc100aa@xray.gatech.edu (Ray Spalding) writes:
- >In article <1992Sep11.145441.5720@cbfsb.cb.att.com> edb1@cbnewsf.cb.att.com (edward.benyukhis) writes:
- >>In article <67971@hydra.gatech.EDU> cc100aa@xray.gatech.edu (Ray Spalding) writes:
- >>> t = gotoproc(1,2,3);
- >>This is somewhat erroneous. The way you invoke a function is:
- >> t = (*gotoproc)(1,2,3);
- >
- >[H&S say that the former is also legal. Doesn't ANSI say that, too?]
-
- Yes, it's legal in ANSI C to invoke a function through a pointer without
- explicitly dereferencing it. I personally avoid this, both for backward
- compatibility (some, but not all, Classic C compilers accept it that way)
- and because I think it's better style to distinguish (*pf)() and f().
-
- Karl W. Z. Heuer (karl@ima.isc.com or uunet!ima!karl), The Walking Lint
-