 <p>In C, the <code>sizeof</code> operator does not evaluate its argument. This allows one to write code that looks wrong but is correct. For example, an idiomatic way to call <code>malloc()</code>, given a type <code>T</code> is:</p> <pre><code>#include &lt;stdlib.h&gt; T *data = NULL; data = malloc(sizeof *data); </code></pre> <p>Here, <code>*data</code> is not evaluated when in the <code>sizeof</code> operator (<code>data</code> is <code>NULL</code>, so if it were evaluated, Bad Things would happen!).</p> <p>This allows one to write surprising code, to newcomers anyway. Note that no one in their right minds would actually do this:</p> <pre><code>#include &lt;stdio.h&gt; int main() { int x = 1; size_t sz = sizeof(x++); printf("%d\n", x); return 0; } </code></pre> <p>This prints <code>1</code>, not <code>2</code>, because <code>x</code> never gets incremented.</p> <p>For some <em>real</em> fun/confusion with <code>sizeof</code>:</p> <pre><code>#include &lt;stdio.h&gt; int main(void) { char a[] = "Hello"; size_t s1 = sizeof a; size_t s2 = sizeof ("Hi", a); printf("%zu %zu\n", s1, s2); return 0; } </code></pre> <p>(The confusion is only if one is confused about arrays, pointers, and operators.)</p>