breaking the loop

Discussion in 'C' started by vaibhav_89, Oct 24, 2007.

Thread Status:
Not open for further replies.
  1. vaibhav_89

    vaibhav_89 New Member

    Joined:
    Oct 14, 2007
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    0
    which function can i use in c/c++ so that as soon as i press a certain character then the loop breaks away goes into the next loop.
    for example:
    start:
    Code:
    for(..;..;..;) /*loop1*/
    {....;
    .....; /*now if i press any 'a' when loop 1 is excuting then it should go to loop 2
    .....;
    }
    goto strat;
    if(getch()=='a') /* loop 2*/
    for (..;..;..)
    ...;
    ...;
    ..;
     
    Last edited by a moderator: Oct 24, 2007
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
Thread Status:
Not open for further replies.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice