sizeof(type)
or sizeof expression
but e.g. unlike a function, it doesn't evaluate the expression. sizeof(my_function()) doesn't call my_function.
sizeof(a = 12) doesn't assign 12 to a.Edit: Via the C99 spec (http://www.open-std.org/jtc1/sc22/WG14/www/docs/n1256.pdf).
The sizeof operator yields the size (in bytes) of its operand, which may be an expression or the parenthesized name of a type. The size is determined from the type of the operand. The result is an integer. If the type of the operand is a variable length array type, the operand is evaluated; otherwise, the operand is not evaluated and the result is an integer constant.
The type of an assignment expression is the type of the left operand unless the left operand has qualified type, in which case it is the unqualified version of the type of the left operand.
So it is indeed the case that `sizeof(a = 12)` is equivalent to `sizeof(a)` in the C world.
Anyways not all those writing code have CS background
int *foo = malloc(sizeof(*foo));
would make no sense.Edit, except it doesn't treat arguments the same, so no.
sizeof belongs in its own category of unary compile-time(-ish) operators, whose only other member is _Alignof.
If you're so inclined, you might add _Generic and _Pragma to that mix as well, but they aren't really a close fit.
This all comes down to what you think "function" means. If you're living in a C bubble, of course sizeof isn't a function. If you have a wider mapping (!) for the word, then it is a kind of function.
In C89, sizeof is always compile-time.
I know a CS major who insisted in pointing out the same thing. He was extremely surprised when dragons hatched from his eggs instead of the chickens he expected. It was a really heated event. He barely escaped -- and then ranted for several weeks how they were really just eggs and couldn't explain what happened.