title: sizeof a function types in C
body: <p>I have a some cases about <code>sizeof</code> operator, which is used with <strong>function</strong> types.</p>
  
  <p><strong>Case 1</strong> :  <a href="https://wandbox.org/permlink/6hl5w31Amqi2svQR" rel="nofollow noreferrer">[Live Demo]</a></p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  char func()
  {
      printf("sizeof func = %zu\n", sizeof(func())); //Ok. Output : 1
      return 0;
  }
  
  int main(void)
  {
      func();
  }
  </code></pre>
  
  <p>Is <code>sizeof(func())</code> valid in C?</p>
  
  <p><strong>Case 2 :</strong> <a href="https://wandbox.org/permlink/jx4kLjrBnSfetvxb" rel="nofollow noreferrer">[Live Demo]</a> </p>
  
  <pre><code>printf("sizeof func = %zu\n", sizeof(&amp;func())); // error
  </code></pre>
  
  <p>It is not working. compiler give an error. Why?</p>
  
  <p><strong>Case 3 :</strong>  <a href="https://wandbox.org/permlink/1JEiPgN7CZf5DBZD" rel="nofollow noreferrer">[Live Demo]</a></p>
  
  <pre><code>printf("sizeof func = %zu\n", sizeof(&amp;func)); //Ok. Output : 8
  </code></pre>
  
  <p>Here, Is <code>sizeof(&amp;func)</code> equal to the sizeof the pointer?</p>
  
  <p>Here, <strong>case 3</strong> working fine, where as <strong>case 2</strong> give an error. Why?</p>