[SOLVED]Getting array lenght inside a function

KeithRB:
Since in C, the array size must be known beforehand, the array size calculation is done at compile time, not run time.

I read so too, but I was surprised that the sizeof calculation worked in function parameter while program running, I figured it should work inside the function too.
So I should store the array size in variable when compiling? Will the sizeof function get corrupted sometime as the "array decays into pointer"? That would cost an extra stored integer for each array, just for the length.