econjack:
There is no way a function can know the size of the array because arrays are passed to a function by reference. That is, the function receives the memory address (lvalue) of where the array resides in memory. The only possible exception is a null terminated character array that's treated as a string.
That is incorrect, it is not a reference to the array or a pointer to it. Passing the array name without subscript operators decays the array type to a pointer of its first element, nothing to do with the original array. Which is why the sizeof operator does not work, as you are no longer dealing with an array.
Pass pointer to first element,
void someFunc( int *ptr ){
}
someFunc( array );
Pass array by reference:
void someFunc( int (&array)[10] ){
}
//OR
void someFunc( int array[10] ){
}
someFunc( array );
Pass array by pointer.
void someFunc( int (*array)[10] ){
}
someFunc( &array );