title: Visual Studio skipping multiple if statements?
body: <p>I'm making a simple maze program that generates a maze. Currently I was working on making one and only solution to a maze, when I stumbled onto something weird. When I debug this code I see that VS is just skipping my if statements here:</p>
  
  <pre><code>        for (i = 0; i &lt;= (col * row) / 200; i++)
          {
          solution[se[0]][se[1]] = 1;
          if (lab[se[0] + 1][se[1]]) se[0] + 1;
          else if (lab[se[0]][se[1] + 1]) se[1] + 1;
          else if (lab[se[0] - 1][se[1]]) se[0] - 1;
          else if (lab[se[0]][se[1] - 1]) se[1] - 1;
  
          solution[se[2]][se[3]] = 1;
          if (lab[se[2] - 1][se[3]]) se[2] - 1;
          else if (lab[se[2]][se[3] - 1]) se[3] - 1;
          else if (lab[se[2] + 1][se[3]]) se[2] + 1;
          else if (lab[se[2]][se[3] + 1]) se[3] + 1;
          }
  </code></pre>
  
  <p>I hope it's not a duplicate, but I have no slightest idea what's the problem here, so it could be one.</p>
  
  <p>Here's the full code if someone wants to replicate the problem:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;iostream&gt;
  #include &lt;Windows.h&gt;
  #include &lt;string&gt;
  
  CONSOLE_SCREEN_BUFFER_INFO csbi;
  int **lab, **solution;
  int col, row, i, j;
  
  int main() {
      GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &amp;csbi);
      col = csbi.srWindow.Right - csbi.srWindow.Left; row = csbi.srWindow.Bottom - csbi.srWindow.Top + 1; i = 0; j = 0;
      lab = new int* [row];
      for (i = 0; i &lt; row; ++i)
          lab[i] = new int[col];
      solution = new int* [row];
      for (i = 0; i &lt; row; ++i)
          solution[i] = new int[col];
  
      for (i = 0; i &lt; row; i++) {           // Build basic maze
          for (j = 0; j &lt; col; j++) {
              if (i == 0) lab[i][j] = 0;
              else if (i == j == 1) lab[i][j] = 1;
              else if (i == 1 &amp;&amp; j == col - 1) lab[i][j] = 1;
              else if (i == row - 1) lab[i][j] = 0;
              else if (j == 0) lab[i][j] = 0;
              else if (j == col - 1) lab[i][j] = 0;
              else {
                  if (lab[i - 1][j] == 0) lab[i][j] = rand() % 2;
                  else {
                      if (lab[i - 1][j - 1] + lab[i - 1][j + 1] + lab[i - 2][j] &lt;= 1) lab[i][j] = 1;
                      else {
                          lab[i][j] = rand() % 2;
                      }
                  }
              }
          }
      }
  
      int se[4] = { 1,1,1,col - 1 };
  
      for (i = 0; i &lt;= (col * row) / 200; i++)        // Generate a solution
      {
          solution[se[0]][se[1]] = 1;
          if (lab[se[0] + 1][se[1]]) se[0] + 1;
          else if (lab[se[0]][se[1] + 1]) se[1] + 1;
          else if (lab[se[0] - 1][se[1]]) se[0] - 1;
          else if (lab[se[0]][se[1] - 1]) se[1] - 1;
  
          solution[se[2]][se[3]] = 1;
          if (lab[se[2] - 1][se[3]]) se[2] - 1;
          else if (lab[se[2]][se[3] - 1]) se[3] - 1;
          else if (lab[se[2] + 1][se[3]]) se[2] + 1;
          else if (lab[se[2]][se[3] + 1]) se[3] + 1;
      }
      while (se[0] != se[2] || se[1] != se[3])
      {
          if (se[0] &lt; se[2])
          {
              if (lab[se[2] - 1][se[3]]) se[2] - 1;
              if (lab[se[0] + 1][se[1]]) se[0] + 1;
          }
          if (se[1] &lt; se[3])
          {
              if (lab[se[2]][se[3] - 1]) se[3] + 1;
              if (lab[se[0]][se[1] + 1]) se[1] + 1;
          }
          solution[se[0]][se[1]] = 1;
          solution[se[2]][se[3]] = 1;
      }
  
  
      std::string out;
      for (i = 0; i &lt; row; i++) {            // Print maze
          for (j = 0; j &lt; col; j++) {
              if (solution[i][j]==1) out.append("@");
              else if (!lab[i][j]) out.append("#");
              else out.append(" ");;
          }
          std::cout &lt;&lt; out &lt;&lt; '\n';
          out="";
      }
  
      system("pause");
  
      for (i = 0; i &lt; row; ++i) delete[] lab[i];
      delete[] lab;
  }
  </code></pre>
  
  <p>I'm sorry, this code is a mess, because it's still work in progress.</p>
  
  <p>BTW I'm using VS 2019, didn't try it in another compiler yet. Is it really a compiler's fault?</p>