Quick question about arrays and functions

Just looking for confirmation.

When passing an array to a function it automaticaly passes a pointer to the array and not a copy of the array of values without having to tell the function to expect a pointer.
So if within the function you change any of the values in the array, the array being passed is changed as it was the pointer to the array not a copy of the array.

Hope that makes sense.
Have I got it ?

Gordon

Correct.

Thanks,
I was scouring the playground, reference and tutorials to confirm this.
Maybe its worth putting a note in the reference section under arrays.

Gordon

It sort of makes sense, if you think about it.
An array could have hundreds, thousands or even millions of elements (though not on an Arduino) - copying all that data onto the stack would be terribly inefficient.
However, the same rule doesn't apply to "structs", which could contain large arrays - they are passed by value, just like any simple data type.