char c[] = {\'a\',\'b\',\'c\'}; int* p = &c[0]; printf(\"%i\\n\", sizeof(*p)); //Prints out 4 printf(\"%i\\n\", sizeof(*c)); //Prints out 1
I a
Because p is of type int *, so *p is of type int, which is apparently 4 bytes wide on your implementation.
p
int *
*p
int
And use %zu for printing size_t (what sizeof yields) if you don't want your program to invoke undefined behavior.
%zu
size_t
sizeof