I have a pointer to a member function defined inside a class, for example:
class Example { void (Example::*foo)(); void foo2(); };
In my main code, I set foo as:
Example *a; a->foo = &Example::foo2;
However, when I try to call foo:
a->foo();
I get the following compile-time error: "error: the expression preceding the parentheses of the visible call must have (function type" pointer-to-function ""). I guess somewhere I get the syntax, can someone point me to this?
source share