title: C if statement comparing two integer variables to the same constant
body: <p>I am trying to compare two integer variables to a same constant. Apparently in this case, both variables have the same default values. I tried to simplify the comparison statement like this:</p>
  
  <pre><code>if (po-&gt;app_tag == po-&gt;inst_id == 0)
     return 1;
  </code></pre>
  
  <p>It didn't work.</p>
  
  <p>I had to code it like:</p>
  
  <pre><code>if ((po-&gt;app_tag == 0) &amp;&amp; (po-&gt;inst_id == 0))
     return 1;
  </code></pre>
  
  <p>To make it work. Can anyone explain to me the difference between the two? Somehow I feel that C compiler should have a provision for this kind of syntax when it comes to comparison of two integer variables. I can be wrong asking for it.. :), but want to understand a reason.. Why am I wrong here.</p>