Thread overview
Global variables
Feb 20, 2008
Saaa
Feb 20, 2008
Saaa
February 20, 2008
How are global variables accessed?

If a function wants to read/write to one, will it get a reference to it or a copy?

(I should learn asm :)


February 20, 2008
"Saaa" wrote
>
> How are global variables accessed?
>
> If a function wants to read/write to one, will it get a reference to it or a copy?
>
> (I should learn asm :)

All usage of global variables reference the same data.  If you want a copy, declare a local variable and copy the value of the global to the local variable.

-Steve


February 20, 2008
Ok, thanks.
Using global variables isn't a performance penalty then.

> All usage of global variables reference the same data.  If you want a copy, declare a local variable and copy the value of the global to the local variable.
>
> -Steve
>