We can pass reference of an array to a function like:
void f(int (&a)[5]); int x[5]; f(x); //okay int y[6]; f(y); //error - type of y is not `in
With C++11's trailing return type syntax, you can also write:
auto foo () -> int (&)[3] { static int some_array[3]; // doesn't have to be declared here return some_array; // return a reference to the array. }