This is the mail archive of the
mailing list for the GCC project.
Re: simple for loop on g++ 4.4.3
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: eric lin <ericlin at fsshl dot zzn dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 29 Oct 2010 01:33:04 +0100
- Subject: Re: simple for loop on g++ 4.4.3
- References: <D4AF3A0BEC8B2F94A83BF5257C06D203@ericlin.fsshl.zzn.com>
On 28 October 2010 23:41, eric lin wrote:
> ?you can see both programs, their for loop are very similar(or the same)
> for (int i=0
> but why first , and second programs can not compile
> the third one is OK
This mailing list is for development of gcc, not help using it, please
send these sort of questions to gcc-help mailing list, as described at
Please take any further questions to the gcc-help mailing list.
Your first and second examples are not valid C++, the error tells you
why. The variable 'i' is declared in the for-loop and is not in scope
after the loop.