Why I can't have declaration and logical operator together?
<p>For efficiency reason (though very small) I would like to declare and assign a variable within the if condition block. </p>

<p>I.e. instead of saying</p>

<pre><code>if(a != 0 &amp;&amp; a-&gt;b &gt;= 10){
    int c = a-&gt;b
    ...
}
</code></pre>

<p>I want to assign int c at the first place and say</p>

<pre><code>if(a != 0 &amp;&amp; (int c = a-&gt;b) &gt;= 10){
    ...
}
</code></pre>

<p>In its most straightforward way (to me) of doing that, I get compile error. does anyone know if it is/isn't possible to do this in c++?</p>
