continue bypasses the rest of the block and starts again at the top of the block if the loop condition is met.
Next question: "What should I do, then?" There are two answers that I can think of.
Example:
void foo () { size_t i = 0; do { if ( ) { continue; } i++; } while ( ); }
Solution # 1: Manual Zoom
void foo () { size_t i = 0; do { if ( ) { i++; continue; } i++; } while ( ); }
Solution # 2: clearly goto *
void foo () { size_t i = 0; do { if ( ) { goto foo_next; } foo_next: i++; } while ( ); }
goto valid in this case, since the increment in two places is technically the same instruction. This solution is especially relevant when iteration-dependent variables are more complex; for example, setting multiple variables or changing a value using an equation or function.
In the case of a single increment or decrement operator, decision No. 1 may be favorable; however, it should be noted that: if the code was changed after such an implementation, you must remember to update both instances of the instruction (which may be subject to errors, especially if changes occur after a long period of time **). Therefore, I highly recommend Decision No. 2.
* Some people think that any use of goto bad practice. I recommend you decide for yourself and leave this: google for "c goto bad"
** Perhaps a comment reminiscent of this need may be sufficient, but if my recommendations have been implemented, the variables depending on each iteration are limited to one statement. And I quote:
There is never a reason to comment on one line
-Linus Torvalds (source: http://yarchive.net/comp/linux/coding_style.html )