I am trying to pass an indicator in a function that is defined in another class in another class. After more research, I believe my syntax is correct, but I am still receiving compiler errors. Here are some code that shows my problem:
class base {public: BaseClass (); Virtual ~ Base Class (); }; Assign Strongfunction for Function Pointer Passed in Public Base (Public: // Derivate (string (* funPtr) (int): Strongfunction;;; derivative;; Personal; // Indicator string; * strFunction ) (Int value) function;}} class main class {public: mainclass ()} {// allocate to a new divined class and pass it a point in my function base * myClass = new receive (& MainClass :: myFunction);} Error MyFunction {// Return a string}};
When I try to compile this code, I get the error
Error: There is no match for mail to call: Derivative :: string (Main class :: *) (int))
After that
Note: The candidates are: Derivative :: Derivative (string (*) (int))
Any ideas what I am doing wrong?
Change your syntax is correct for the C style function pointer:
Derived (string (MainClass :: * funPtr) (int): strFunction (funPtr) {}
and
string (mainclass: : * Strontication) (int value); Remember to call strfunction
, you will need an example of the mainclass object. Often I find useful in using typeface.
Type typed field (Main class :: * func_t) (int); Func_t strFunction;
and
derived (func_t funPtr): strFunction (funPtr) {}
Comments
Post a Comment