i have a header file with a class and several declaration and non-static member functions like this:
//foo.h
...
#include <bar.h>
class foo
{
...
public:
void myFunction();
};
and a header file with a struct and a class like:
//bar.h
...
struct baz
{
class foo;
...
void (foo::*functionPointer)() = NULL;
}
class bar
{
...
public:
static myOtherFunction();
};
and i want to address the function pointer in bar.cpp's static function "myOtherFunction" like:
void bar::myOtherFunction()
{
...
baz b = baz();
b.functionPointer = &foo::myFunction;
}
but this gets me an compiler error:
bar.cpp:247:22: error: cannot convert 'void (foo::*)()' to 'void baz::foo::*)()' in assignment
b.functionPointer = &foo*:myFunction;
Error compiling
Pretty Sure that this is an obvious fault for anyone experienced in c/c++ but for now i'm stuck and would be really grateful about some help. Thank you...