I have a class and one of its member functions is actually a function pointer. That way the user can overwrite what does this function do. I unfortunately have some difficulties
You do not have a class with a "function which is a function pointer", but rather a class with a data member which is a function pointer. This is an important distinction as the function won't receive a this pointer, nor will it have access to protected or private members.
You've declared your function pointer correctly, but you need to use the .fcn_ptr
rather than .*fcn_ptr
. I believe this is sufficient to solve your problem.
Do note that you're using old C style function pointer syntax. You may want to learn the C++ function pointer alternatives including std::function
.