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: 
You can't put the `break` in another method.

Though if you want `case 1` and `case 2` to do the same thing, this is legal:

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

```
Don't put the break in the function. Plain and simple.

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

```