variable initialization within an if statement blocks
<p>Every time I initialize a variable within an <em>if-statement</em>'s blocks and its <em>else</em>'s blocks, and use it afterward, the compiler spits an error: the variable isn't declared. For example:</p>

<pre><code>if (/*Some expression*/)
  int a=5;
else
  int&amp; a=c;

//...

a++; // Variable not declared
</code></pre>

<p>My compiler would say that <em>a</em> is not declared. The main problem about any declaration other than in an <em>if-statement</em> is that in one case the variable <em>a</em> must be a reference, which must be set when it is initialized. Also, I don't really want to create a new variable unless it is necessary, which it isn't when it could be a reference.</p>

<p>Is there something else I'm doing wrong? Or a way to pass the error? Or some type of variable prototype?</p>
