continue

Sometimes you find yourself in the middle of the code block and you need to say, Forget the rest of this run through the code block and start the next run through the code block. This is done with the continue command. For example, what if you were pretty sure that no multiples of 3 satisfied the equation? How would you avoid wasting precious time checking those?

#​i​n​c​l​u​d​e​ ​<​s​t​d​i​o​.​h​>​

i​n​t​ ​m​a​i​n​(​i​n​t​ ​a​r​g​c​,​ ​c​o​n​s​t​ ​c​h​a​r​ ​*​ ​a​r​g​v​[​]​)​
{​
 ​ ​ ​ ​i​n​t​ ​i​;​
 ​ ​ ​ ​f​o​r​ ​(​i​ ​=​ ​0​;​ ​i​ ​<​ ​1​2​;​ ​i​+​+​)​ ​{​
 ​ ​ ​ ​ ​ ​ ​ ​i​f​ ​(​i​ ​%​ ​3​ ​=​=​ ​0​)​ ​{​
 ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​c​o​n​t​i​n​u​e​;​
 ​ ​ ​ ​ ​ ​ ​ ​}​ ​ ​ ​ ​ ​ ​ ​ ​p​r​i​n​t​f​(​"​C​h​e​c​k​i​n​g​ ​i​ ​=​ ...

Get Objective-C Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.