Like the other answer says, put the & after the *.
This brings up an interesting point that can be confusing sometimes: types should be read from right to left. For example, this is (starting from the rightmost *) a pointer to a constant pointer to an int.
int * const *x;
What you wrote would therefore be a pointer to a reference, which is not possible.
Yes, but when argument matching for a reference, the implicit array to
pointer isn't automatic, so you need something like:
void foo( double (&array)[42] );
or
void foo( double (&array)[] );
Be aware, however, that when matching, double [42] and double [] are
distinct types. If you have an array of an unknown dimension, it will
match the second, but not the first, and if you have an array with 42
elements, it will match the first but not the second. (The latter is,
IMHO, very counter-intuitive.)
In the second case, you'll also have to pass the dimension, since
there's no way to recover it once you're inside the function.
8.3.5.8 If the type of a parameter includes a type of the form “pointer to array of unknown bound of T” or “reference
to array of unknown bound of T,” the program is ill-formed