Date: Mon, 1 Dec 1997 21:23:15 -0600 (CST) From: Andrew Deren To: gilley cc: djgpp AT delorie DOT com Subject: Re: C++ and globals ?? In-Reply-To: <34832B11.7408@netunlimited.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk You can use ::variable to refer to global variables inside a method On Mon, 1 Dec 1997, gilley wrote: > 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. :) > ,,, (0 0) +-------------oOO----(_)-------------------+ | Andrew Deren | | aderen AT eecs DOT uic DOT edu | | www.eecs.uic.edu/~aderen/ader/main.html | +-------------------------oOO--------------+ || || ooO Ooo