Question: I have a switch statement:

```
swtich(x)
{
    case 1:
           ...
           break;
    case 2:
           ...
           break;
}

```

I want to put the `...` code in a function but I want to put the break too... So I want something like that

```
void func()
{
     ...;
     break;
}

swtich(x)
{
    case 1:
           func();
    case 2:
           func();
}

```

Break gives error (I know why) but what I can do?

Answer: 
As others have said, it's not possible. Look at it this way, what would be the expected behavior be if you were not inside a switch statement when the execution gets to the `break;` line?

Put the `break;` statement after the function call. If you want the function to stop execution under a given condition, use the `return;` statement.
Don't put the break in the function. Plain and simple.

```
switch(x)
{
    case 1:
           func();
           break;
    case 2:
           func();
           break;
}

```