When we pass an element of an array to a function, it is treated as an normal variable and the called function creates a copy of the actual argument and operates on it. Any changes made in the formal arguments doesn't affect the actual arguments.

But this not the case when we pass a whole array. In this case it (called function) gets access to the actual arguments and any changes made in the formal arguments affects the actual arguments. Why this happens?