delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/01/20:16:15

From: gilley <gilley AT netunlimited DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: C++ and globals ??
Date: Mon, 01 Dec 1997 16:24:33 -0500
Organization: NetUnlimited, Inc.
Lines: 31
Message-ID: <34832B11.7408@netunlimited.net>
NNTP-Posting-Host: uhura-37.netunlimited.net
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Here is a simple C++ question.
I forget how this works. Would some one 
refresh my memory.
        
           //***Example***//
  
 //globals
 FONT *myfont;
 FONT *systemfont;

 class MyClass
 {
    Font *myfont;
    void afunction(void);

 };
 void MyClass::afunction(void)
 {
    systemfont=myfont;
 };

  OK now the question is.. in afunction()
  is the systemfont now poining to MyClass.myfont
  or is it pointing to the global myfont?

  How do I distinguish the two? Should I say
  This.myfont to be sure I am getting the myfont
  var in the class?

                 Thanks all, 
   I know its a dumb question. :)

- Raw text -


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