conditional troubles

This is a discussion on conditional troubles within the C Programming forums, part of the General Programming Boards category; I want to be able to get entirely out of a conditional tree. how do I do this? Here is ...

  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
    Katy, Texas
    Posts
    2,309
    goto can be used, or you could call raise(), or abort(), or break out of your while loop.
    Mac and Windows cross platform programmer. Ruby lover.

    Quote of the Day
    12/20: Mario F.:I never was, am not, and never will be, one to shut up in the face of something I think is fundamentally wrong.

    Amen brother!

  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, 11:22 PM
  2. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 03:39 PM
  3. Event driven conditional??
    By theeld in forum C Programming
    Replies: 4
    Last Post: 10-10-2006, 01: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, 10:28 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21