Home > Back-end >  For help, why the array size is not the same as in the main function and the function?
For help, why the array size is not the same as in the main function and the function?

Time:12-14

 # include  

Void access (int a [], [3], int row) {
Printf (" access_sizeof in (a)=% d \ n ", sizeof (a));
Printf (" in access_sizeof (* a)=% d \ n ", sizeof (* a));
Int rank=(sizeof (a)/sizeof (* a));
for(int i=0; I for(int j=0; J Printf (" % d t \ \ t ", a [I] [j]);
}
printf("\n");
}
}

Int main () {
Int a [4] [3]={{1, 2, 3}, {4 and 6}, {7,8,9}, the final three {10}};
Printf (" main_sizeof in (a)=% d \ n ", sizeof (a));
Printf (" in main_sizeof (* a)=% d \ n \ n ", sizeof (* a));
Access (a, 3);
return 0;
}
  • Related