I wrote a function containing array as argument, and call it by passing value of array as follows.
void arraytest(int a[])
{
// changed the array a
a
In C, except for a few special cases, an array reference always "decays" to a pointer to the first element of the array. Therefore, it isn't possible to pass an array "by value". An array in a function call will be passed to the function as a pointer, which is analogous to passing the array by reference.
EDIT: There are three such special cases where an array does not decay to a pointer to it's first element:
sizeof a
is not the same as sizeof (&a[0])
.&a
is not the same as &(&a[0])
(and not quite the same as &a[0]
).char b[] = "foo"
is not the same as char b[] = &("foo")
.