Hello all,
At the moment im trying out with pointing to an array of functions. I got this working as following:
But now I'm trying to use this to point to a function inside a class so instead of do11, i want to be able to point to Basic.Do11. Somehow this doesnt work and I keep on getting this message:
error: argument of type 'void (Basic::)()' does not match 'void (*)()'
Any ideas?
At the moment im trying out with pointing to an array of functions. I got this working as following:
Code:
typedef void (* functionPtr) ();
functionPtr functions[2][2]={{do11,do12}, {do21,do22}};
void do11(){DEBUG_PRINTLN("11");}
void do12(){DEBUG_PRINTLN("12");}
void do21(){DEBUG_PRINTLN("21");}
void do22(){DEBUG_PRINTLN("22");}
void loop(){
A=0;
B=1;
functions[A][B]();
}
error: argument of type 'void (Basic::)()' does not match 'void (*)()'
Any ideas?
Comment