title: How sizeof operator works in C?
body: <p>In this below code:</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  int main(void)
  {
      printf("%d",sizeof(int));
      return 0;
  }
  </code></pre>
  
  <p>When compiled on gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4 compiler it gives  warning: </p>
  
  <blockquote>
    <p>format ‘%d’ expects argument of type ‘int’, but argument 2 has type
    ‘long unsigned int’ [-Wformat=] printf("%d",sizeof(int));</p>
  </blockquote>
  
  <p>Why I am getting this warning? Is it that return type of sizeof is 'long unsigned int' ?</p>
  
  <p>When I replaced '%d' with '%ld' the warning went.</p>