BDRichardson
Programmer
Hi,
Please can anyone confirm as to whether when you pass a variable to a function as an argument, whether the variable becomes another instance of the variable?
For example, I declare a global string variable, and pass it to a function as an argument. I wish to change the value of the global variable. I find that I can change the value of the variable within the function, but the actual variable outside of the function does not change. It would seem that the variable becomes a local variable, which is a copy of the global variable.
Can anyone please make some sense of what is actually happening?
Please can anyone confirm as to whether when you pass a variable to a function as an argument, whether the variable becomes another instance of the variable?
For example, I declare a global string variable, and pass it to a function as an argument. I wish to change the value of the global variable. I find that I can change the value of the variable within the function, but the actual variable outside of the function does not change. It would seem that the variable becomes a local variable, which is a copy of the global variable.
Can anyone please make some sense of what is actually happening?