3 ms·
No. However, if you pass an object or an array, the called function can change a field in the object or an element in the array (the difference between those t
by cynwoody 13y ago
No.
However, if you pass an object or an array, the called function can change a field in the object or an element in the array (the difference between those two is an optimization), and the change will be visible to the caller.
Go, however, lets you pass in an explicit pointer to an int, through which the function can change the int to which the caller pointed. Of ourse, the caller can also change the passed-in pointer if it wants, but that has no effect on the caller's variable.