No, the function parameter is a reference to an array of Len
const chars. That's how the function knows the length (assuming the last byte is a NUL terminator, hence the -1). The parentheses are there precisely to stop it being what you think it is.
Actually there's no such thing in C++ as an array of references, so it couldn't be what you think it is even without the parens. I guess (but am not sure) that the need for the parens is just for consistency with other similar type definitions, such as pointers to arrays:
void fn(const char *a[3]); // parameter a is of type const char**, the 3 is ignored.
void fn(const char (*a)[3]; // parameter a is a pointer to an array of 3 const chars.
That example also illustrates why an array is not a pointer. Predict the output of the following program, and then run it:
#include <iostream>
void fn(const char (*a)[3]) {
std::cout << sizeof(a) << "\n" << sizeof(*a) << "\n";
}
void fn2(const char *a[3]) {
std::cout << sizeof(a) << "\n" << sizeof(*a) << "\n";
}
int main() {
const char a[3] = {};
const char **b = 0;
fn(&a);
fn2(b);
}
#if 0
// error: declaration of `a' as array of references
void fn3(const char & a[3]) {
std::cout << sizeof(a) << "\n" << sizeof(*a) << "\n";
}
#endif