Note that a function parameter of array type isn't treated as an array, but as a pointer. (The array syntax is allowed, but only pointer semantics are implemented.) The following two declarations are equivalent:
void fill_array_with_square_numbers(int *first, int length); void fill_array_with_square_numbers(int first[], int length);
Within the definition of this function, sizeof first
will still equal sizeof(int *)
,
even if we place a length inside the square brackets
(such a value is ignored anyway).