title: C represent int in base 2
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2611764/can-i-use-a-binary-literal-in-c-or-c">Can I use a binary literal in C or C++?</a>  </p>
  </blockquote>
  
  
  
  <p>I am learning C and i recently found out that we can represent integers in different ways, like that:</p>
  
  <p>(Assuming <code>i</code> has "human-readable" value of <strong>512</strong>.) Here are the representations:</p>
  
  <h2>Decimal:</h2>
  
  <pre class="lang-c prettyprint-override"><code>int i = 512; 
  </code></pre>
  
  <h2>Octal:</h2>
  
  <pre class="lang-c prettyprint-override"><code>int i = 01000;
  </code></pre>
  
  <h2>Hexadecimal:</h2>
  
  <pre class="lang-c prettyprint-override"><code>int i = 0x200;
  </code></pre>
  
  <h2>In base 2 (or binary representation) <strong>512</strong> is <strong>1000000000</strong>. How to write this in C?</h2>
  
  <p>Something like <code>int i = 1000000000b</code>? This is funny but unfortunately no C compiler accepts that value.</p>