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:
Code:
#include "MyClass.cpp" class A { static MyClass* m = new MyClass(); public void example() { m->doSomething(); }
Leave a comment: