Originally Posted by
christop
Nope. Try it out for yourself.
The arguments are still treated as pointers
I stand corrected on this point. sizeof(array) within the function is equal to sizeof(void*). The NELEMS macro cannot be used.
Originally Posted by
christop
and the "array sizes" are ignored by the compiler.
The sizes are not necessarily ignored. They can affect the way the array may be indexed within the function. Consider this function declaration:
Code:
void matprint(int y, int x, int a[y][x]) {
for (int i=0; i < y; i++) {
for (int j=0; j < x; j++)
printf("%3d ", a[i][j]);
printf("\n");
}
}
Within the function, the array may be indexed as if it were a VLA of size [y][x]. If the sizes were reversed, for instance, to `int a[x][y]' then the printed result will be different if x != y.