how to break outer loop from switch case

Posted by Ravisha on Stack Overflow See other posts from Stack Overflow or by Ravisha
Published on 2010-03-12T09:39:53Z Indexed on 2010/03/12 9:47 UTC
Read the original article Hit count: 296

Filed under:
|
|

I have below code ,

enter code here
for(int i=0;i<15;i++)
{
    switch(i)
    {
    case 6:
    break;
    case 7:
    //Want to break the outer loop
    }
}
enter code here

Is there a way to break the loop inside case statement? I know of one way is to use labels and goto .

© Stack Overflow or respective owner

Related posts about c#

Related posts about oops