do-while Loop
Runs the body once, then repeats while the condition is true.
Beginner
Useful for menus and retry loops. Also the idiom for multi-statement macros: do { a(); b(); } while (0).
Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.
Discussion (0)
Sign in or join free to ask questions and discuss this topic.