in reply to Re: Re: Re: Re: Re: for loop localisation bug?
in thread for loop localisation bug?
This code is now legal in C99 compilers (which to my knowledge there are not very many)
for(int i=0; i < 100; i++){ /*do some thing with i */ printf("this is i: %d", i); }
**This code is Not Tested (even for correctness)**{ int i; for(i=0; i < 100; i++){ /*do something here with i */ printf("this is i: %d", i); } }
And this overview of C99
This does NOT invalidate your argument about pre c99 compilers or non-complying compilers. And if you declare your iterator loop varable before the for loop it will work the same as it did previouly. I point this out because I think that this is what these other fine Monks must be thinking of.
MADuran who must now find a spiffy sig.
|
---|