Hi,
I have an abstract class like this:
Code:
class Obj
{
public:
virtual int someFunc()=0;
protected:
struct A
{
int Index;
std::string Name;
std::string Hier;
};
A **a;
};
And then I derive a class from this like this:
Code:
class derObj : public Obj
{
public:
int someFunc();
private:
struct A a[2] = {
{ 1, "name","Top" }, { NULL, NULL, NULL}
}
};
This doesn't work out however and I get error messages:
Code:
error: a brace-enclosed initializer is not allowed here before '{' token
error: ISO C++ forbids initialization of member 'a'
error: making 'a' static|
error: invalid in-class initialization of static data member of non-integral type 'Obj::A [2]'
Please can anybody help me determine what is causing this error. Any help would be appreciated. Thanks.