title: What should be the sizeof(int) on a 64-bit machine?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/589575/size-of-int-long-etc">size of int, long, etc</a><br>
    <a href="https://stackoverflow.com/questions/2331751/does-the-size-of-an-int-depend-on-the-compiler-and-or-processor">Does the size of an int depend on the compiler and/or processor?</a><br>
    <a href="https://stackoverflow.com/questions/9689049/what-decides-the-sizeof-an-integer">What decides the sizeof an integer?</a>  </p>
  </blockquote>
  
  
  
  <p>I'm using a <code>64-bit</code> machine.</p>
  
  <pre><code>$ uname -m
  x86_64
  $ file /usr/bin/file
  /usr/bin/file: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, stripped
  $ 
  </code></pre>
  
  <p>When I ran the following program, I got the <code>sizeof(int)</code> as <code>4-bytes</code>.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main(void)
  {
      printf("sizeof(int) = %d bytes\n", (int) sizeof(int));
  
      return 0;
  }
  </code></pre>
  
  <p>If I'm running a <code>16-</code>, <code>32-</code> and <code>64-</code> bit machine, then doesn't it mean that the size of an <code>integer</code> is <code>16-</code>, <code>32-</code> and <code>64-</code> bit respectively?</p>
  
  <p>In my machine, I found the <code>WORD_BIT</code> is <code>32</code>. Shouldn't it be <code>64</code> on a <code>64-bit</code> machine? </p>
  
  <pre><code>$ getconf WORD_BIT
  32
  $ 
  </code></pre>
  
  <p>And, shouldn't the <code>sizeof(int)</code> be <code>64-bits</code> (<code>8 bytes</code>) in the above case?</p>