Some C++ questions
Mike Stump
mrs@wrs.com
Mon Oct 27 18:40:00 GMT 1997
> From: Ross Alexander <r.alexander@auckland.ac.nz>
> To: egcs@cygnus.com
> Date: Tue, 28 Oct 1997 14:35:42 +1300 (NDT)
> Here are a couple of C++ scoping questions I have.
I think comp.lang.c++ is a better place to drag people's knowledge of
C++ out of them. This isn't the place for people to teach you c++.
This is a place where compiler experts join together to implement a
set of compilers.
If you have trouble interpreting the standard, this might be
reasonable, though, even for that I wish people would hit comp.std.c++
first. If you're going to implement it, then asking here would be
fine.
> int main()
> {
> if (int i = 10)
> i++; // should be okay
> i++; // shold be out of scope
> }
> SGI CC v7.0 doesn't like the declaration within the if statement.
SGI is out of date. We should get this right.
> 2)
> int main()
> {
> for (int i = 0; i < 10; i++)
> cout << i;
> for (int i = 0; i < 10; i++) // should be fine
> cout << i;
> }
> Both SGI CC v7.0 and SunPro CC 4.2 barf horribly at this.
They are both out of date, we should get this right.
More information about the Gcc
mailing list