your syntax is correct for a C function function pointer. Change it like this:
Derived(string (MainClass::*funPtr)(int)) : strFunction(funPtr) {}
and
string (MainClass::*strFunction)(int value);
Remember to call strFunction , you will need an instance of the MainClass object. Often I find it helpful to use typedefs.
typedef string (MainClass::*func_t)(int); func_t strFunction;
and
Derived(func_t funPtr) : strFunction(funPtr) {}
Evan teran
source share