can I "break"/"continue" in a while loop in objective开发者_StackOverflow中文版-c?
(or are these reserved only for for loops)
Yes of course you can! Give it a try!
From Apple's Objective-C docs:
Objective-C is defined as a small but powerful set of extensions to the standard ANSI C language.
So break and continue can be used wherever they are permitted in C.
continuecan be used in looping constructs (for,whileanddo/whileloops).breakcan be used in those same looping constructs as well as inswitchstatements.
Yes, you can. They work the same way. break exits the loop and continue goes to the beginning and checks the condition again.
加载中,请稍侯......
精彩评论