Xref: utzoo comp.lang.c++:13462 comp.lang.c:39298 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!samsung!think.com!spool.mu.edu!uunet!taumet!steve From: steve@taumet.com (Stephen Clamage) Newsgroups: comp.lang.c++,comp.lang.c Subject: Re: Pointers to functions Message-ID: <730@taumet.com> Date: 15 May 91 15:39:47 GMT References: Followup-To: comp.lang.c++ Organization: Taumetric Corporation, San Diego Lines: 29 aj3u@wilbury.cs.virginia.edu (Asim Jalis) writes: >What is the difference between these two (pf is a pointer to a >function, and hello is a function): >pf = hello; >and >pf = &hello; There is no difference. The oddity is this: A function designator appearing in an expression context is replaced by the address of the function, making a pointer-to-function. Attempts to take the address of the function designator are ignored. So hello &hello &&&&&&&&&&&&&&&&hello are all equivalent. Similarly, when you dereference a pointer-to-function, you get a function designator, which is replaced by pointer-to-function. Consequently, pf() (*pf)() (****************pf)() are all equivalent. -- Steve Clamage, TauMetric Corp, steve@taumet.com