pass by reference of array in c++ code example
Example 1: array as parameter c++
void myFunction(int param[]) {
.
.
.
}
Example 2: array reference argument
template<typename T, size_t N>
void foo(T (&bar)[N])
{
// use N here
}
void myFunction(int param[]) {
.
.
.
}
template<typename T, size_t N>
void foo(T (&bar)[N])
{
// use N here
}