From: "Kim Seng" Newsgroups: comp.os.msdos.djgpp Subject: Re: Help in my codes. Date: Wed, 18 Sep 2002 10:22:46 +0800 Organization: Singapore Telecommunications Ltd Lines: 35 Message-ID: References: <3voboug43iagagl91bk5o4buuu2is8fava AT 4ax DOT com> NNTP-Posting-Host: 203.125.52.233 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hi Guys, Thanks for the information, I tried to run the codes with 2 other compliers, TClite and MS Visual C++ and I could run the codes as in my attachement. But for TClite, I had append #include instead of #include and comment out using namespace std; The codes that I had attached is from a reference book that I'm now learning. But I'm using DJGPP to complie it. If you are interested in the author, he is SCHILDT. The book name is C++ from Ground up, 2 edn. Thanks again. "Hans-Bernhard Broeker" wrote in message news:am4ptt$7g0$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE... > MCheu 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.