title: c++ : confused as to why the compiler is giving error not declared in this scope
body: <p>This skeleton example part of my code is causing the error 'x' not declared in this scope. I would have thought the computer would do both the Krow > 2 and Krow == 3 statements. </p>
  
  <pre><code>void GaussianElimination::JacobianFiller(){
  
      if(Krow &gt; 2){
          double x = Y(0);
      }
      if(Krow == 0){
       //............. stuff
      }
      else if(Krow == 3){
          double a = x
      }
  }
  </code></pre>