Forceing a for-loop to exit
I searched around and couldn't find anything on the subject.
My code looks a little like this ....
Code:
for(int i = 0; i < array->count; i++)
{
if(some condition)
{
do stuff // Activate a tool tip
(this is where I want to force the for loop to exit)
}
else
{
do other stuff // deActivate a tool tip
}
}
The problem is after the tool tip is activated in the if statement, if the for loop runs again then it is deActivated in the else statement.
So what I want to be able to do is exit out of the for loop inside of the if statement.
Re: Forceing a for-loop to exit
use the break statement.
search: loops break continue
Re: Forceing a for-loop to exit