title: One line assignment according condition in c/c++
body: <p>
  Hi,</p>
  
  <p>i would like to know which one of these assignments is faster, safer, better etc. and possibly why:</p>
  
  <pre class="lang-c prettyprint-override"><code>int choice = fgetc(stdin);
  unsigned int bSize;
  
  choice = fgetc(stdin)
  </code></pre>
  
  <p>1:</p>
  
  <pre class="lang-c prettyprint-override"><code>bSize = (choice == 'y' || choice == 'Y') ? 256 : 128;
  </code></pre>
  
  <p>2:</p>
  
  <pre class="lang-c prettyprint-override"><code>bSize = 128 + ((choice == 'y' || choice == 'Y') &lt;&lt; 7);
  </code></pre>
  
  <p>Thanks.</p>