title: C - Code after switch in for loop ignored
body: <p>I have this bit of code in C:</p>
  
  <pre><code>for(int y = 1; y &lt;= array_size; y++){          //outer loop starts here
      for(int x = 1; x &lt;= array_size; x++){      //inner loop starts here
  
              switch(array[x][y]){
              case 1: dosomething;
              case 2: dosomething;
              case 3: dosomething;
              }
  
              makestuff;                        //this line is ignored
      }                                         //inner loop ends here
      outerloop;                                //outer loop - everything works fine      
  }                                             //outer loop ends here
  </code></pre>
  
  <p>and as you can see if I use switch, the code after it is just ignored despite it still being in the inner loop.</p>
  
  <p>But if I rewrite the code like this:</p>
  
  <pre><code>for(int y = 1; y &lt;= array_size; y++){          //outer loop starts here
      for(int x = 1; x &lt;= array_size; x++){      //inner loop starts here
  
          if(array[x][y]==1)
              dosomething;
          else if(array[x][y]==2)
              dosomething;
          else if(array[x][y]==3)
              dosomething;
  
              makestuff;                        //works
      }                                         //inner loop ends here
      outerloop;                                //outer loop - everything works fine              
  }                                             //outer loop ends here
  </code></pre>
  
  <p>it works as I expected. It would not a problem if I used the second method but I would just like to know why the first method does not work.</p>
  
  <p>Thank you for your answers.</p>