Firstly, the way you access the array is wrong. Inside your function you have a pointer to an array. The pointer has to be dereferenced first, before you use the []
operator on it
void Func(int (*a)[5])
{
for (int i = 0; i < 5; i++)
cout << (*a)[i];
}
Secondly, i don't understand why you need to "get" the size of the array, when the size is fixed at compile time, i.e. it is always 5. But in any case you can use the well-known sizeof
trick
void Func(int (*a)[5])
{
for (int i = 0; i < sizeof *a / sizeof **a; i++)
cout << (*a)[i];
}
The sizeof *a / sizeof **a
expression is guaranteed to evaluate to 5 in this case.