Mail Archives: djgpp/2002/09/18/10:31:11
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 <iosteam.h> instead of #include <iostream>
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" <broeker AT physik DOT rwth-aachen DOT de> wrote in message
news:am4ptt$7g0$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE...
> 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 -