3 ms·
This works for the example as typed, but not if there is a body to the original loop.
by jws 15y ago
This works for the example as typed, but not if there is a body to the original loop.
- onemoreact 15y agoA little ugly but you can get it to work without duplicate code by: bool second_loop = false; do { if (second_loop) {...} update_thing(&foo); second_loop = true; } while (foo != 0); The real question is which is more clear when some else looks at the code. I suspect even if it's shorter and faster while (foo,bar) is less clear to most people than the above code.