You can use goto
.
while ( ... ) {
switch( ... ) {
case ...:
goto exit_loop;
}
}
exit_loop: ;
More Related Contents:
- How can I get out of the loop and continue the loop again?
- How to deal with c-string pointers [closed]
- Lowercase letters that did not appear in the array, in order [closed]
- Triple Nested For loop (C++) [closed]
- Loops in loops and increment staying at 0 in C++ [closed]
- C++ – How to clear variables after a while loop? [closed]
- Don’t know how to add loop to my program…?
- Optimizing away a “while(1);” in C++0x
- How to generate different random numbers in a loop in C++?
- Const before or const after?
- Can I use break to exit multiple nested ‘for’ loops?
- When is the “typename” keyword necessary? [duplicate]
- How can I loop through a C++ map of maps?
- Is using a ‘goto’ statement bad?
- Is there any overhead to declaring a variable within a loop? (C++)
- What are the advantages of list initialization (using curly braces)?
- Can the template parameters of a constructor be explicitly specified?
- Why Switch/Case and not If/Else If?
- Why is using the function name as a function pointer equivalent to applying the address-of operator to the function name?
- iterate vector, remove certain items as I go
- Good input validation loop using cin – C++
- How do I select a range of values in a switch statement?
- What’s this C++ syntax that puts a brace-surrounded block where an expression is expected?
- Why are memcpy() and memmove() faster than pointer increments?
- GetDIBits and loop through pixels using X, Y
- Why does this call the default constructor?
- What’s the syntax for declaring an array of function pointers without using a separate typedef?
- passing object by reference in C++
- C++ strings: [] vs. *
- How can Duff’s device code be compiled?