by acconsta · 11y ago · 0 comments
void example(int a[10]);
Why can't the compiler tell a is an int array of size 10 instead of a pointer?
When you pass an array to this function you are not copying the entire array, C is pass by value, therefore you must pass a pointer. In fact a behaving like an array would be lying to the programmer since you didn't make a copy of the array.
My "online search" found Walter Bright, who knows a thing or two about C compilers, wondering the same thing: