The question is the following: consider this piece of code:
#include <iostream>class aClass{public: void aTest(int a, int b) { printf("%d + %d = %d", a, b, a + b); }};void function1(void (*function)(int, int)){ function(1, 1);}void test(int a,int b){ printf("%d - %d = %d", a , b , a - b);}int main(){ aClass a; function1(&test); function1(&aClass::aTest); // <-- How should I point to a's aClass::test function?}
How can I use the a
's aClass::test
as an argument to function1
? I would like to access a member of the class.