digitalmars.D.learn - Global variables
- Saaa (4/4) Feb 20 2008 How are global variables accessed?
- Steven Schveighoffer (5/9) Feb 20 2008 All usage of global variables reference the same data. If you want a co...
- Saaa (2/7) Feb 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 :)
Feb 20 2008
"Saaa" wroteHow 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
Feb 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
Feb 20 2008