HI,
I have a for loop
for(int i=0;i<=1000;i++)
{
}
I want to stop the for loop for an particular value like i=100 without applying break point. so how can we achieve it?
HI,
I have a for loop
for(int i=0;i<=1000;i++)
{
}
I want to stop the for loop for an particular value like i=100 without applying break point. so how can we achieve it?
if(i==100) break; // exits the loop
Or
if(i==100 && Debugger.IsAttached)
Debugger.Break(); // pauses the IDE
You can achieve it with using breakpoint.
Right-click on breakpoint and click condition. Set your conditions there.
Refer to this link for further info. :D