about "break"
-
- Take a look at such codes below: loop1{ loop2{ // want to break here } } //next code to execute - If I want to break from "// want to break here" to "//next code to execute", how to use the statement "break" to implement the task? Can I use "break [label]", like in Java? - Can you show me an example? - Regards, Maer
-
- Take a look at such codes below: loop1{ loop2{ // want to break here } } //next code to execute - If I want to break from "// want to break here" to "//next code to execute", how to use the statement "break" to implement the task? Can I use "break [label]", like in Java? - Can you show me an example? - Regards, Maer
You can't use break with a label. Use goto for that. Tomasz Sowinski -- http://www.shooltz.com
-
- Take a look at such codes below: loop1{ loop2{ // want to break here } } //next code to execute - If I want to break from "// want to break here" to "//next code to execute", how to use the statement "break" to implement the task? Can I use "break [label]", like in Java? - Can you show me an example? - Regards, Maer
You can do one of three things 1/ Use goto - this has the down side of having to sell your soul to the dark side 2/ Use a bool condition to help you know to break twice. This has the downside of being messy 3/ Use try/catch/throw. This has the downside of being good C++ and resulting in lesser mortals feeling jealous and not inviting you to their parties. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001