www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/10/08/20:11:08

From: Erik Max Francis <max AT alcyone DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: C++ problem
Date: Thu, 01 Oct 1998 11:55:10 -0700
Organization: Alcyone Systems
Lines: 26
Message-ID: <3613D00E.6B294297@alcyone.com>
References: <6udqfn$sdk$1 AT inf6serv DOT rug DOT ac DOT be> <360A8B31 DOT 53CF31E9 AT earthlink DOT net> <36101229 DOT C4659B15 AT unb DOT ca>
NNTP-Posting-Host: charmaine.alcyone.com
Mime-Version: 1.0
X-Mailer: Mozilla 3.01 (X11; I; Linux 2.0.34 i686)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Endlisnis wrote:

>     This is wrong.  It would take the address of the variable
> containing the
> address of the function.

No.  In these cases PrintMode0 and PrintMode1 are both member function
pointers of the appropriate class and prototype for the member function
pointer which will be used to store them.  The class designation (e.g.,
&Test::PrintMode0) is not necessary because these entities are being
referenced within the scope of that class already, so they are not
needed (e.g., &PrintMode0).

Note that even in ANSI C, using the address-of operator on a function
has no effect; it's superfluous, but it certainly doesn't "take the
address of the variable containing the address of the function," since
there is no such thing.

-- 
Erik Max Francis / email max AT alcyone DOT com / whois mf303 / icq 16063900 
Alcyone Systems / irc maxxon (efnet) / finger max AT sade DOT alcyone DOT com
  San Jose, CA / languages En, Eo / web http://www.alcyone.com/max/
          USA / icbm 37 20 07 N 121 53 38 W / &tSftDotIotE
             \
            / The work will teach you how to do it.
           / (an Estonian proverb)

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019