void test(int p1[10], int p2) {
int l1;
int l2[10];
printf("params are at %d and %d\n", &p1, &p2);
printf("locals are at %d and %d\n", &l1, &l2[0]);
}
int main(void) {
test(5, 10);
}
I'm a bit confused by the code above... how can we supply an argument of 5 to the test function when the function has already specified an array of p[10]. The output address is also very strange, the p1 and p2 should have been 40 addresses apart (array of 10 elements times 4 bytes per int). But the console shows that they're only 4 units apart....