C – SizeOf Pointers

Because p is of type int *, so *p is of type int, which is apparently 4 bytes wide on your implementation.


And use %zu for printing size_t (what sizeof yields) if you don’t want your program to invoke undefined behavior.

Leave a Comment