I don't see why you need to use the static keyword at all... Maybe I'm not thinking right as it's 3:30 AM here, but I don't think I've ever seen
static variables used outside of a class/struct.
The only reason I know of to use static variables is, when used before a data member in a class, it forces the value of that data member to be the same amongst all instances of the class. I.e., if you use this code:
class MyClass{
public static int data;
};
MyClass myObject1;
MyClass myObject2;
//At this point, myObject1.data and myObject2.data must
//always be the same, as they are 2 ways to refer to the
//same variable.
By definition any global variable will always act this way -- as there can be only one instance of the global variable -- so what, then, is the
static supposed to do, anyhow? Maybe if I knew why you needed it, I could offer more advice.
(Sorry, BTW, if this makes no sense, or is really dumb. It's 3:30 AM, that's my excuse and I'm sticking to it)
[Edited by Paul Victorey on 12-30-2000 at 04:40 AM]