Originally Posted by p3lim
Variables are values of places in memory, when you create a new local variable inside that function, that is an entirely new memory position the value is stored in.
Every time you run that function the local variable is created anew, and will get the "latest" from the global variable (there's no static variables in Lua).
The only reason you'd want to differentiate the variable naming in a scenario like this is to avoid confusion, nothing more.
|
Hi p3lim,
So, Lua doesn't have an ability to access to an address of variable, does it?
(Like that is in C++ and so on)