|
|
|
|
|
by dangerbird2
3357 days ago
|
|
the Big "I" is the type, which is a macro parameter. The variable name "i" is not a parameter. If There is another variable "i" in the scope, the loop variable will shadow it in the DO statement. Something like this float i = 10;
DO({i+= 10;} 20);
will evaluate to this, modifying the "i" declared inside the macro float i_1 = 10;
{I i_2=0,_n=(n);for(;i_2<_n;++i_2){i_2 += 10;}}
|
|
So that would make this:
You're still right that it will shadow any 'i' declared outside and so it won't work but it will not overwrite it as far as I can see. You'll just end up right where you started.What I really don't get is if they're going to use _n for the count anyway why not count it down to 0, that way the whole 'i' could be avoided.
(you'd still have a problem with _n but that could be overcome with a convention, which of course someone will forget with some nasty bug as a result)