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
You are not passing the array as copy. It is only a pointer pointing to the address where the first element of the array is in memory.