Why isn\'t the size of an array sent as a parameter the same as within main?
#include
void PrintSize(int p_someArray[10]);
int main () {
So, you will need to pass the lenght of the array as a second parameter. When you are writing code, in which you both declare an array of constant size, and later pass that array to a function, it is a pain to have the array-length constant show up several places in your code...
K&R to the rescue:
#define N_ELEMENTS(array) (sizeof(array)/sizeof((array)[0]))
So now you can do e.g:
int a[10];
...
myfunction(a, N_ELEMENTS(a));