How does passing a statically allocated array by reference work?
void foo(int (&myArray)[100]) { } int main() { int a[100]; foo(a); }
The following creates a generic function, taking an array of any size and of any type by reference:
template void my_func(T (&arr)[S]) { // do stuff }
play with the code.