For Double Condition

Hi, I'd like to have a for condition with two interrupting conditions:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
for(temp=hl;temp!=NULL,bOver1==true; temp=temp->next){
	bOver=false;
	int I=0;
	while(bOver==false){
		if(cu.Chars('S')[I]>temp->custs.Chars('S')[I]){
			bOver=true;
			prev=temp;
		}else if(cu.Chars('S')[I]<temp->custs.Chars('S')[I]){
//FOUND THE ONE GREATER: PREV STAYS THE ONE BEFORE AND LOOP MUST END HERE!
			bOver=true;
			bOver1=true;
		}
		i++;
	}
}


This is a part of the code, where I try to put order in a list, simply looking for the previous one, checking the surname. As you can see I tried to put 2 conditions in the for, so that when I find the greater one, I exit the while (surname checker) and then the for (the bOver1 is a boolean flag: false = continue, true = stop).
When I launch it the for loop is simply jumped, even if the list has 3 variables and bOver1 is set to false in the declaration.
What's wrong? Is it possible to make something like I asked?
Thank you!
The second part is exactly like a condition anywhere else, so you will need to use the boolean operators (&&, ||, etc)
 
for(temp=hl;(temp!=NULL)&&(bOver1==false); temp=temp->next)


This is the only way it works, with the OR condition passes through anyway
Topic archived. No new replies allowed.