I am surprise that the C# compiler will let you do this.
The result is that we will only loop once in the first loop.
static void LoopIssue() { for (int i = 0; i < 5; i++){ Console .WriteLine("i:{0}" , i); for (i = 0; i < 10; i++){ Console .WriteLine(" i:{0}" , i); } } }
No comments:
Post a Comment