You don't pass the whole array to a function. You pass a pointer to the first element in the array to the function. Try something like this:
Code:
void func(int nums[10])
{
int i;
for(i = 0;i < 10;++i)
nums[i] = i;
}
int main(void)
{
int i;
int nums[10];
func(nums); // An equivalent call would be func(&nums[0]);
for(i = 0;i < 10;++i)
printf("%d\n", nums[i]);
return 0;
}
The parameter in func() can actually be expressed in different ways, and the size of the last dimension can actually be omitted. These definitions would all work:
Code:
void func(int nums[10])
void func(int nums[])
void func(int *nums)
Since you're passing a pointer to the first element in the array, your function doesn't have its own local copy of the array. Any changes you make to the array in your function are reflected in the calling function.