title: Why does declaration is valid, and intialization is not in switch statement
body: <p>I've already read this &quot; <a href="https://stackoverflow.com/questions/92396/why-cant-variables-be-declared-in-a-switch-statement">Why can't variables be declared in a switch statement?</a> &quot;.</p>
  <p>However, I still can't understand why does this work:</p>
  <pre class="lang-cpp prettyprint-override"><code>switch(n){
  case VAL:
      int a;
      ...
      break;
  case OTHER_VAL:
      a = 12
      ...
      break;
  }
  </code></pre>
  <p>suppose to this:</p>
  <pre class="lang-cpp prettyprint-override"><code>switch(n){
  case VAL:
      int a = 12;
      ...
      break;
  case OTHER_VAL:
      ...
      break;
  }
  </code></pre>
  <p>I understand that that initialization part is bypassed, at the label <code>val</code>, so why does the declaration part isn't?.</p>