[b][red]This message was edited by smallmoovz at 2002-7-31 0:20:53[/red][/b][hr]
Usually, a variable is passed from a calling function to a called function by value if it is required that the value of the variable in the calling function is not affected ( changed ) by the operations carried out upon that variable in the called function. Arrays however, are passed by reference and hence any changes made to the array in the called function affect the array in the calling function too. A couple of ways to prevent this from happening :
1) Copy the array to another identical array in the calling function and then pass the copy to the called function.
2) Pass the array to the called function, element-by-element ( array elements are passed by value ).
Is there a better and more efficient way to pass an entire array by value from a calling function to a called function? If yes, pray what is it?