title: transfer a function as a parameter to a different function
body: <p>I am trying to transfer a function as a parameter to a different function.</p>
  
  <p>for some reason it is not working.</p>
  
  <pre><code>//myClass.h
  class MyClass
  {
  public:
  
  typedef int (*MyClass::ptrToMember)(float, char);
  
    ptrToMember p1;
    MyClass::MyClass();
    void hello(ptrToMember fun);
  
    int SendIt (float a, char b); 
  
  };
  
  
  
  //MyClass.cpp
  MyClass::MyClass(){
    p1 = &amp;(MyClass::SendIt);
    hello(p1);
  
  }
  int MyClass::SendIt (float a, char b) 
  { 
    std::cout &lt;&lt; "MyClass::SendIt "&lt;&lt;a&lt;&lt;std::endl; 
  
    return 1; 
  }
  
  void MyClass::hello(ptrToMember fun){
  
   int result = (*fun)(12, 'a');
    std::cout &lt;&lt; result &lt;&lt; std::endl;
  }
  </code></pre>
  
  <p>would appreciate it, if someone can tell me what my mistake is.</p>