Thanks for your recommendation~
but it comes new error message
redefinition of 'int MyClass::MyVariable'
or what you mean is to leave this static member in global environment?
and I found that , the public member can be private or protected, if assign as public, it will be error as I try to.
new I have two way to do,
- put static member to private, and add function call in public to access that static member
- put static member to private, then add a variable pointer in public, in this case main program can access the static member in data pointer way..
I just wandering is anyway to keep static member public in sperate file?