I am trying to pass two multidimensional arrays as reference arguments to a function in C++.
The prototype is written like this:
void func(char (&foo)[4][4], char (&bar)[4][4]);
My problem is that the second argument does not get passed as a reference argument, but the first one does. If I change their placement – so (&foo)[4][4] is second and vice versa – foo does not get passed as a reference but bar does.
However if I add a third argument, the second argument gets passed as reference.
How can I fix this without having to add another useless argument?