Can I assign a value to a static public memeber in a class?
NOMAD
Printable View
Can I assign a value to a static public memeber in a class?
NOMAD
Code:MyClass::MyStaticMember = 2; //Assuming MyStaticMember is a integer
Do I need to have an instance of my class declared? I tried that and I'm getting linker errors in MSVC++ 6 saying unresolved symbol
Maybe I'm missing something, but what's the point in using a static member if you don't plan to instantize your class?
I wanted to use initialize it by my main program. Then use it with the class function (reather the constructer). I know that sounds pretty dangerous but as long as I document thats how it works I think it should be alright.
NOMAD
PS I made them public static int seems to work great.
Thanks everyone!