Xref: utzoo comp.lang.c++:13484 comp.std.c:4840 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!crdgw1!uunet!zephyr.ens.tek.com!tektronix!reed!intelhf!ichips!inews!pima!bhoughto From: bhoughto@pima.intel.com (Blair P. Houghton) Newsgroups: comp.lang.c++,comp.std.c Subject: Re: Pointers to functions Message-ID: <4253@inews.intel.com> Date: 15 May 91 23:37:37 GMT References: <1512@caslon.cs.arizona.edu> Sender: news@inews.intel.com Organization: Intel Corp, Chandler, AZ Lines: 32 In article <1512@caslon.cs.arizona.edu> dave@cs.arizona.edu (Dave Schaumann) writes: >You have found one of the weirdnesses of ANSI-C. When you have a pointer >to a function, you (normally) invoke the function by saying > (*funptr)() >However, ANSI, in it's infinite wisdom, decided that you should be able to >say > funptr() >in the same context, with similar results. It's not weird at all. It's rather consistent. The actual syntax is () where the expression must evaluate to a function pointer. A similar thing is true of arrays, structs, and unions, where the syntaxes are [] . -> The only thing remotely weird about it is that now `funptr' and `*funptr' are the same thing, but that's why function poiners are often singled out for different semantic treatment in the standard (many things you can do with a pointer to int are forbidden with a function pointer). --Blair "Many things you can do with your own nose are forbidden with your neighbor's."