Hey everyone,
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:
The error that gives me is "request for member `doSomething' in `A::m', which is of non-class type `MyClass ()()'"
I've also tried with the same result
Could someone direct me to what the solution is? Thank you
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();
}
};
I've also tried with the same result
Code:
#include "MyClass.cpp"
class A
{
static MyClass m();
public void example()
{
m.doSomething();
}
};
Comment