Just a point on "reading through the code": I did "dir /s *.h *.cpp" on ONE of the directories of the code I'm working on, that I have worked a bit with: 2.9MB. Another one, that I know very little...
Type: Posts; User: matsp
Just a point on "reading through the code": I did "dir /s *.h *.cpp" on ONE of the directories of the code I'm working on, that I have worked a bit with: 2.9MB. Another one, that I know very little...
Yes, but it's no longer a global variable - it's a variable accessed through a pointer (in some way - it may be an offset from a segment variable in x86, but that's for all intents and purposes a...
Yes, but you only need to look at the code where the variable originates and then follow it through the call-chain until the variable isn't being used any more. Most of the time, that's only half a...
That does make the variable a non-global, as it's now a Thread-Local-Storage (TLS) variable - and I much prefer to not use compiler-specific extension to make TLS work - as most OS's and compilers...
You should not be using globals as replacement for arguments to a function.
By passing a variable to a function, you know that function will modify that argument. If you have global variables,...
You mean things like "volatile"? That doesn't make anything "safer" - it makes the compiler not optimize the read/write operations to the data item (and in later versions of MS compilers "lock" the...