[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
CBreak
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
CBreak
(C) break
Keyword enabling you toExamples
End a for-loop
for(int i=0; i<100; ++i)
{
if (i==69 && rand()%2==0) break;
//Code
}
End a ?while-loop
int i=0;
while(1)
{
if (i==69 && rand()%2==1) { break; }
++i;
}
End a switch-statement
int main() { switch(rand()%2) { case 0: printf("Threw heads."); break; case 1: printf("Threw tail."); break; } return 0; }
- include <stdio.h>
Code links
'break' links
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
