2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by masijade
0

Because i is defined within the loop and the condition of the lopp is, technically, outside the loop. A variable only "exists" within the scope in which it is created, in this case only inside the loop and not outside.

Edit: Do note, however, that a variable created outside the loop is visible within because the loop is contained within the scope in which the variable was created.

Edited by masijade: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.