205k views
3 votes
When you pass an array as an argument to a function, the function can modify the contents of the array?

User MayNotBe
by
7.9k points

1 Answer

6 votes
In most languages. Primitive data types ( char, int, float, bool, maybe string ) are usually passed by value, but compound data types are passed by reference, so you're not working on a copy but on the original.
User Fabio Buda
by
8.4k points