This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: simple for loop on g++ 4.4.3


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
> but
> 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
http://gcc.gnu.org/lists.html
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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]