Is there any difference between the below two functions test1 and test2
static int const MAXL = 3;
void test1(int t[MAXL])
{
for (int i = 0; i < MAXL; ++i)
t[i] = 10;
}
void test2(int (&t)[MAXL])
{
for (int i = 0; i < MAXL; ++i)
t[i] = 10;
}
With my testing in MSVC2008, both functions modifies the input array values. It seems both the functions are same in their functionality.
Can anyone give a case that need a reference to array in a function parameter?