C++ question: static
Expert, i have a question on static.
The partial code is as following:
[quote]
// in a class Object
...
private:
typedef void (Object::*Omf) ();
static Omf farray[3];
...
[/quote]
Here i can't understand why "static" is a must?
I have tried to remove "static" but then i get compilation error message:
menu1.cpp:17: 'void (Object::* Object::farray[3]()' is not a static member of 'class Object'
Here static seems not a lifetime issue. Thanks for you enlightenmen.
The partial code is as following:
[quote]
// in a class Object
...
private:
typedef void (Object::*Omf) ();
static Omf farray[3];
...
[/quote]
Here i can't understand why "static" is a must?
I have tried to remove "static" but then i get compilation error message:
menu1.cpp:17: 'void (Object::* Object::farray[3]()' is not a static member of 'class Object'
Here static seems not a lifetime issue. Thanks for you enlightenmen.
Who knows who will love your smile in next minute