You can define sum
that way and call it as shown in your example, but in that case you will not be able to determine the size of the array inside the function.
What you could do is declare sum
as
int sum(int (*a)[5])
{
...
}
and then call it as
total = sum(&(int []){1,2,3,4,5});
But in this case you will be restricted to arrays of size 5
only. If you want to have a function that works with arrays of any size, you have to either pass the size from outside or reserve some sort of "terminator" element in your array