For example, you have the language c code:
int *p = (int *)malloc(8);
for some reason, if i print the size of the pointer p, even though it has 8 bytes (as i allocated it with malloc) it shows 4 when i print it:
printf("%i", sizeof(p)); // results on 4
i know that the default size of an integer is 4, but i'm allocating more memory than that with malloc, i'm allocating 8 bytes and it's still printing 4 when i do sizeof, why is that happening?