Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. about "break"

about "break"

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialjavaquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Maer727
    wrote on last edited by
    #1

    - 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

    T C 2 Replies Last reply
    0
    • M Maer727

      - 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

      T Offline
      T Offline
      Tomasz Sowinski
      wrote on last edited by
      #2

      You can't use break with a label. Use goto for that. Tomasz Sowinski -- http://www.shooltz.com

      1 Reply Last reply
      0
      • M Maer727

        - 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

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups