title: Class member function pointer as a class member
body: <pre><code>// class
  class MyClass
  {
  public:
  void doIt() const
  {
      cout &lt;&lt; "It works!" &lt;&lt; endl;
  }
  
  void(MyClass::*fPtr)() const;
  };
  
  // main
  
  MyClass *t = new MyClass;
  
  // store function address
  t-&gt;fPtr = &amp;MyClass::doIt;
  
  (*(t-&gt;fPtr))(); // Whats wrong with this line?
  </code></pre>
  
  <p>How can i call the function stored in fPtr? when i try (*(t->fPtr))(); compiler gives 
  those errors :</p>
  
  <p>error C2171: '*' : illegal on operands of type 'void (__thiscall MyClass::* )(void) const</p>
  
  <p>error C2064: term does not evaluate to a function taking 0 arguments</p>