Here is my sample code
#include<stdio.h>
void main()
{
int arr[]={1,2,3,4,5,6};
char *ptr,a;
a='c';
ptr=&a;
int *ptr1,a1;
a1=4;
ptr1=&a1;
printf("%d %d %d",sizeof(arr), sizeof(ptr1), sizeof(ptr));
}
Now, as far as I understand, size of will tell me the size required to store the variable, now the output for this one is
24 4 4
Why is the size of arr=24
, after all it's just a pointer and it should be having size =4 ?
Thanks.