delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/09/18/10:01:08

From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Help in my codes.
Date: 16 Sep 2002 14:30:21 GMT
Organization: Aachen University of Technology (RWTH)
Lines: 18
Message-ID: <am4ptt$7g0$1@nets3.rz.RWTH-Aachen.DE>
References: <am3jv2$vbr$1 AT reader01 DOT singnet DOT com DOT sg> <3voboug43iagagl91bk5o4buuu2is8fava AT 4ax DOT com>
NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de
X-Trace: nets3.rz.RWTH-Aachen.DE 1032186621 7680 137.226.32.75 (16 Sep 2002 14:30:21 GMT)
X-Complaints-To: abuse AT rwth-aachen DOT de
NNTP-Posting-Date: 16 Sep 2002 14:30:21 GMT
Originator: broeker@
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

MCheu <mpcheu AT yahoo DOT com> wrote:

> You first declare a global variable named count.   This variable is
> visible to all functions within this program, so its scope encompasses
> the scope of func2() as well.   

No, that's not the actual problem.  That's valid coding (although it's
considered dangerous by some) in C, and still so in C++ AFAIK.  This
coding practice might have triggered a warning if you requested the
compiler to be in a very nit-picky mode (---> -Wshadow), but not an
error like the one quoted.

Note that the conflict shown in the quoted error messages was between the
source file and an STL header, not between two places in the source file.

-- 
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -


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