title: Why do I have to use %ld when referring to the size of an int variable?
body: <p>I define an int like this:</p>
  
  <pre><code>int a;
  </code></pre>
  
  <p>When I want to lookup the size of this int, I have to use the format specifier %ld like this:</p>
  
  <pre><code>printf("int size is %ld\n", sizeof(a));
  </code></pre>
  
  <p>When I use %d as the format specifier, I get the following error:</p>
  
  <pre><code>foo.c:7:10: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat=]
      printf("int size is %d\n", sizeof(a));
  </code></pre>
  
  <p>The question is, why is the result of sizeof() defined as long unsigned int when the parameter of the function is an int? </p>