comp.lang.c++:
[snip]
It's legal to pass an array in a function call, it's just not possible
No, it is not. It is one of Dennis Ritchie's few unfortunate lapses
in judgment. The name of an array, in all contexts except when used
as the operand of the sizeof operator, is converted to a pointer to
its first element. It is literally impossible to pass a naked array
by value.
for the function called to recover it. In C++ an array passed by value
"decays" into a pointer to its first element by the time the receiver
gets it.
It has nothing to do with "when the receiver gets it". The receiver
receives exactly what the function definition specifies, and when you
write a definition with a parameter of type TYPE array[], you are
actually defining a parameter of type TYPE *array. The conversion
happens in the caller, the array is never passed.
It is unfortunate that this syntax was ever allowed in a function
declaration. It has added to the confusion between pointers and
arrays in C and C++ for more than 30 years. And it leads to erroneous
statements like "it's legal to pass an array in a function call",
which help perpetuate the confusion.