#include<stdio.h>
#include<conio.h>
void main()
{
int a[5]={1,2,3,4,5};
int (*p)[5];
int *p1[5];
clrscr();
printf("%d\n",(int)sizeof(a)); // 10
printf("%d\n",(int)sizeof(p)); //2
printf("%d\n",(int)sizeof(p1)); //10
getch();
}
First output is 10 because each integer is of 2 bytes and hence 5 integers would take 10 bytes.
I am not able to understand the 3rd output which is 10. Here we have array of pointers each pointing to an integer. Size of pointer(or address) in my system is 32 bits (4 Bytes) . So the output should be 5*4=20 right as we have 5 pointers each of 4 bytes ?