Checking if a value is within a range in if statment
<p>I did below:</p>

<pre><code>if( '0' &lt;= infix.at(i)&lt;= '9'){
// some logic
}
</code></pre>

<p>Compiler gave me warning unsafe use of type 'bool' in operation. I changed it to following:</p>

<pre><code>if( '0' &lt;= infix.at(i)&amp;&amp; infix.at(i) &lt;= '9') 
</code></pre>

<p>now it works. Is the first one not allowed in C++??</p>
