You can't pass an array by value, but only by reference.
Code:


void f(int* p, int n)
{
int i = 0;
for(i = 0; i < n; i++)
{
p[ i] = 100; // Write over memory area that is where p points to + sizeof(int) * i. That's where the i'th element is at.
}
}
int main()
{
int arr[10];
f(arr, 10); // "arr" means: a pointer to the first element.
}