|
-
Jun 3rd, 2011, 07:21 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Doesn't enter for loop
Here is the loop code:
Code:
for(int i = 1; i == args.Length;i++)
{
}
When I breakpoint it, it goes to the i = 1 then the args.Length and then it just goes to the code under the loop?? Why?
-
Jun 3rd, 2011, 07:26 AM
#2
Re: Doesn't enter for loop
The loop will execute as long as the second expression (i == args.Length) evaluates to true.
Is this the case? Does args.Length return 1? Even if that was the case, it would only execute the loop once.
-
Jun 3rd, 2011, 07:29 AM
#3
Thread Starter
Hyperactive Member
Re: Doesn't enter for loop
args.Lenght return 8 when I use breakpoints....
-
Jun 3rd, 2011, 07:31 AM
#4
Re: Doesn't enter for loop
I assume you intend to iterate over the contents of args?
Code:
for(int i = 0; i < args.Length; i++)
{
}
-
Jun 3rd, 2011, 07:36 AM
#5
Thread Starter
Hyperactive Member
Re: Doesn't enter for loop
Now it works 
I had used == instead of <.
Oh and I want to start from 1.
Thx for helping :P
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|