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
When passing an array as a parameter, this
void arraytest(int a[])
means exactly the same as
void arraytest(int *a)
so you are modifying the values in main.
For historical reasons, arrays are not first class citizens and cannot be passed by value.