P
pico
I am attempting to write an app that allows me to reference class
members from a structure. There is only one instance of this class so
I have no problem making the members (obj1, obj2, etc.) static. I can
get build the structure fine but Im having trouble dereferencing it.
My app runs under CE so I would really like the structure to be a const
to keep it in rom. Here is a simplified version of my code. Can
someone help me out?
class A{
public:
dosoething(){return 1};
};
class B{
public:
A obj1; // these can be made static
A obj2;
A obj3;
private: // or this can be public
INT somefunction();
};
struct objList{
A B::*objPtr;
int otherdata;
}
const objList bla[3]={{&B:
bj1,10},{&B:
bj1,20},{&B:
bj3,30}};
INT B:somefunction{
int i;
for(i=0,i<3,i++){
(*(bla.objPtr)).dosomething();
}
}
members from a structure. There is only one instance of this class so
I have no problem making the members (obj1, obj2, etc.) static. I can
get build the structure fine but Im having trouble dereferencing it.
My app runs under CE so I would really like the structure to be a const
to keep it in rom. Here is a simplified version of my code. Can
someone help me out?
class A{
public:
dosoething(){return 1};
};
class B{
public:
A obj1; // these can be made static
A obj2;
A obj3;
private: // or this can be public
INT somefunction();
};
struct objList{
A B::*objPtr;
int otherdata;
}
const objList bla[3]={{&B:
INT B:somefunction{
int i;
for(i=0,i<3,i++){
(*(bla.objPtr)).dosomething();
}
}