I am trying to declare a static class variable (not a 'primitive' variable, but from a class i wrote) inside a class
However, I have tried several ways to initialize it and they all caused compilation errors:
Expand|Select|Wrap|Line Numbers
- #include "MyClass.cpp"
- class A
- {
- static MyClass* m = new MyClass();
- public void example()
- {
- m->doSomething();
- }
- };
I've also tried with the same result
Expand|Select|Wrap|Line Numbers
- #include "MyClass.cpp"
- class A
- {
- static MyClass m();
- public void example()
- {
- m.doSomething();
- }
- };