array-address

Why pointer is giving two different addresses?

穿精又带淫゛_ 提交于 2019-12-11 21:32:51
问题 I have this program. And I have some doubts. You can run it in your compiler. I am using gcc compiler in linux #include<stdio.h> int main() { int j=4,*add; int i=2; int a[i][j]; for (i=0;i<=1;i++) { for(j=0;j<=3;j++) { scanf("%d",&a[i][j],"%d",&a[i][j]); } } for(i=0;i<=1;i++) { for (j=0;j<=3;j++) { add=&(a[i][j]); printf("\nSize of %d is %d and address is: %u that should be equal to: %d",a[i][j],sizeof(a[i][j]),&(a[i][j]),add);//Address are not equal while add is having the value of &(a[i][j]