title: use of undeclared identifier and unused variable warning of same variable
body: <p>I'm making a c++ program and in it I have the section </p>
  
  <pre><code>Point originzarm = normalizevector(camera.origin.x, camera.origin.y, camera.origin.z);
  if (camera.origin.x == 0 and camera.origin.y == 0) {
      Point originxarm(1,0,0);
  }
  else{
      Point originxarm = normalizevector(camera.origin.y, -camera.origin.x, 0);
  }
  Point originyarm = crossproduct(originxarm.x, originxarm.y, originxarm.z, originzarm.x, originzarm.y, originzarm.z);
  </code></pre>
  
  <p>the functions cross product and normalize vector return points.
  in the else section there's a warning about unused variable originxarm. but when i try to use originxarm while defining originyarm it says use of undeclared identifier originxarm. How could I make originxarm visible after the if else statement and set it within the curly brackets?</p>
  
  <p>PS I asked this a long time ago when I was just beginning to understand C++.</p>