Consider the following C code snippet:
int main() {
int *crr;
int arr[] = {1, 2, 3, 45};
crr = (int *)malloc(sizeof arr);
printf("%ld\n", sizeof arr);
printf("%ld", sizeof crr);
return 0;
}
The output of the above code is :
16
8
I have 64 bit architecture system. Hence, int is 4 bytes. Need explanation or any references for why this is happening. I've allocated same amount of memory to the crr.