It takes a type.
sizeof(char)
is always one. The variable p
itself is a pointer, and on your platform that has a size of 4. Then you do &p
, or a pointer to a pointer, which also has a size of 4.
On most modern desktop systems, a 32-bit architecture will have 4 byte pointers, while a 64-bit architecture will have 8 byte pointers.
sizeof
itself is a keyword, resolved at compile-time, not a function. In C99, arrays can be variable length, and sizeof will wait until run-time to resolve this size.