Possible Duplicate:
Sizeof array passed as parameter
Given the function below I understand that sizeof returns the size of the pointer of the type in the array.
int myFunc(char my_array[5])
{
return sizeof(my_array);
}
However calling sizeof on an array not passed as a parameter normally returns the sizeof the array.
What causes this inconsistency? What is the best way of getting the size of an array when it is passed as a parameter?