I am using PRQA QA C++ as source code analyzer.
This is the first code I analyzed :
void test1(int * var);
void example1()
{
int var1[10];
test1(var1);
}
QA C++ told me
Array type is used as a pointer type argument in the function call.
So, I tried this following example (as it suggested) :
void test2(int (&var)[10]);
void example2()
{
int var2[10];
test2(var2);
}
This time, it told me :
Array type is used as a reference type argument in the function call.
Is there a better solution to use an array parameter ?