Run bool controlled loop once more

  • A+
Category:Languages
bool loop; do {      ... } while (loop); 

I need this loop to run once more after loop is false. I can't use integer counters to make something like while (loop && counter > required) as number of iterations changes with incoming data.


bool loop; int n = 1; do {      ... } while ((loop && n) || n--); 

Comment

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: