Thread: conditional troubles

  1. #1
    Registered User
    Join Date
    Sep 2009
    Posts
    29

    conditional troubles

    I want to be able to get entirely out of a conditional tree. how do I do this?

    Here is sample code
    Code:
    while(1){ //I want to get back here
                 if(/*stuff*/){
                     //stuff
                 }
                   else{
                        //stuff
                        if(){
                          //stuff
                               }
                         else(
                           //more stuff
                            //This is where I am!
    Last edited by cloudsword; 01-26-2010 at 11:56 PM.

  2. #2
    Jack of many languages Dino's Avatar
    Join Date
    Nov 2007
    Location
    Chappell Hill, Texas
    Posts
    2,332
    goto can be used, or you could call raise(), or abort(), or break out of your while loop.
    Mainframe assembler programmer by trade. C coder when I can.

  3. #3
    Registered User
    Join Date
    Sep 2009
    Posts
    29
    Thanks

  4. #4
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    I thought the right word was "continue".

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. regarding conditional statement in xml
    By cnu_sree in forum C Programming
    Replies: 5
    Last Post: 07-21-2007, 10:22 PM
  2. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  3. Event driven conditional??
    By theeld in forum C Programming
    Replies: 4
    Last Post: 10-10-2006, 12:33 PM
  4. NAQ: Everything you never wanted to know about CPP
    By evildave in forum C Programming
    Replies: 21
    Last Post: 12-12-2005, 10:56 AM
  5. Preproccessor conditional compilation
    By Garfield in forum C Programming
    Replies: 5
    Last Post: 09-28-2001, 09:28 AM