Hi
I have a problem understanding the scope of a variable defined in a for
loop.
As I see it the code below should not compile since the variable i can only
be seen in the first for loop.
What did I not understand? thanks.
///code sniff, way can the second loop "see" the variable i?
for(int i=0; i<N; ++i)
{
SumKx += x[i];
}
for(int i2=0; i2<N; ++i2)
y[i] = x[i];
Best regards
Torben Laursen
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.735 / Virus Database: 489 - Release Date: 06/08/2004