A simple question about scope
Hi, this is my first post.
It concerns the scope of a loop control counter object declared inside the for statement...
Here is an example:
Code:
{
statement;
...
statement;
// let's call this "SCOPE 1"
// now...
for (int i=1; 1<=10; i++)
{
statement;
...
statement;
// let's call this "SCOPE 2"
}
statement;
...
// now we're back to "SCOPE 1"
}
Could someone (well, ideally many people) tell me whether the scope of i (as declared inside the for statement) is SCOPE 1 or SCOPE 2 ?
Much obliged,
Doug.