so if i run this code it will give the expected answer of 9
int main()
{
int a[]={9,8,7,6,5,4,3,2,1};
int n=sizeof(a)/sizeof(a[0]); printf("%d", n);
}
but if i change sizeof(a[0])
to sizeof(&a[0])
..then the output is 4
Why does this happen? Exactly what does the computer 'think' when it is given sizeof(&a[0])
?