title: Condition assignment to boolean
body: <p>Emulating booleans in C can be done this way:</p>
  
  <pre><code>int success;
  success = (errors == 0 &amp;&amp; count &gt; 0);
  if(success)
     ...
  </code></pre>
  
  <p>With <code>stdbool.h</code> included following could be done:</p>
  
  <pre><code>bool success;
  success = (errors == 0 &amp;&amp; count &gt; 0) ? true : false;
  if(success)
     ...
  </code></pre>
  
  <p>From what I understand logical and comparison operators should return either 1 or 0.
  Also, <code>stdbool.h</code> constants should be defined so that <code>true == 1</code> and <code>false == 0</code>.</p>
  
  <p>Thus following should work:</p>
  
  <pre><code>bool success;
  success = (errors == 0 &amp;&amp; count &gt; 0);
  if(success)
     ...
  </code></pre>
  
  <p>And it does work on compilers that I have tested it with. But is it safe to assume it is portable code? (Assume that <code>stdbool.h</code> exists)</p>
  
  <p>Is the situation different on C++ compilers as bool is internal type?</p>