Particular loop

Hello!
I know it may be an obvious question, but I haven't to manage an answer anywhere.
How do I create a loop that starts when "b" condition is satisfied, but doesn't stop if "b" condition is no longer verificated?
Thanks!
Last edited on
Please define what "verificated" means. I'm not familiar with that word.
Do you mean something like this?
1
2
3
4
if( /* b condition is true */ )
{
    // Insert loop here
}
I have determinated that a while loop is in order...
1
2
3
4
while( /*insert true condition*/ )
{
    // do something
}
Yes, but with this code, if for example b is at start = 1, then = 2, and finally again = 1, and my while loop needs b to be = 2 to work, in the case I have written before, when b comes back to 1 the while loop stops.
I think what you are saying is that once condition b is satisfied, start the loop, but keep the loop running even if condition b is no longer satisfied.
Perhaps:
1
2
3
4
5
if(/*condition b*/){
     do{
          //loop stuff
     }while(true);
}

This way the loop will continue to run even after b is no longer satisfied. Is that what you're trying to do?
Topic archived. No new replies allowed.