title: How do I print the size of int in C?
body: <p>I am trying to compile the below on RHEL 5.6 , 64 bit, and i keep getting a warning  </p>
  
  <blockquote>
    <p>"var.c:7: warning: format ‘%d’ expects
    type ‘int’, but argument 2 has type
    ‘long unsigned int’"</p>
  </blockquote>
  
  <p>Here is my code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main()
  {
      unsigned int n =10;
      printf("The size of integer is %d\n", sizeof(n));
  }
  </code></pre>
  
  <p>It does not matter if i change the declaration for "n" to following  </p>
  
  <ol>
  <li>signed int n =10;  </li>
  <li>int n = 10;  </li>
  </ol>
  
  <p>All i want to do is print the size of integer on my machine, without really looking into limits.h. </p>