delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/10/01/01:40:10

From: Endlisnis <s257m AT unb DOT ca>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: C++ problem
Date: Mon, 28 Sep 1998 19:46:21 -0300
Organization: BrunNet
Lines: 29
Message-ID: <361011BC.1AF0129D@unb.ca>
References: <6udqfn$sdk$1 AT inf6serv DOT rug DOT ac DOT be>
NNTP-Posting-Host: usr4fton13.brunnet.net
Mime-Version: 1.0
X-Mailer: Mozilla 4.04 [en] (Win95; U)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Johan Verschraegen wrote:

> class Test
> {
>  int testint;
>  void (Test::*PrintPtr)();

    I think "void (*PrintPtr)()" would work fine here.

>  public:
>    Test(int in_testint)
>      {
>      testint=in_testint;
>      }
>    void SetMode(int mode)
>      {
>      if(mode==0) PrintPtr=PrintMode0; <-(1)first warning
>      if(mode==1) PrintPtr=PrintMode1; <-(2)second warning

    You are trying to use the PrintMode0 function, BEFORE it is defined!!
Move the "SetMode" fuction to the end of the class and this should compile.--
     (\/) Endlisnis (\/)
          s257m AT unb DOT ca
          Endlisnis AT GeoCities DOT com
          Endlisnis AT BrunNet DOT Net




- Raw text -


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