Loren Osborn linux_dr at yahoo.com
Tue Sep 3 13:55:01 PDT 2002

On Tue, 2002-09-03 at 13:29, Nick Whitelegg wrote:
> Thanks for the feedback on this. I have to admit, global variables and
> the ins and outs of them were never my strong point, I never knew that 
> by making a global variable "static" it became private!

In C anyway, yes... It's not private, per-se, but sybol-less...  Without
a symbol, no code in any other object file can access it.  This is what
static used to mean.  In C++ static now has several meanings, depending
on context.  With globabl variables, static has the same meaning it did
in C... in a class it refers to a member that can be accessed indepently
of a specific object of that class.  In a function it refers to a local
variable that only gets initialized once (when the function first
executes), and doesn't get destroyed until the program exits...

Hope that helped,


More information about the SDL mailing list