title: How to call a C++ class method, which is given as a parameter?
body: <p>I'm trying to pass a method as a parameter to other method.</p>
  
  <p><code>Magner.h</code>:</p>
  
  <pre><code>Class Manager{
  public:
   timeCount(void (Manger::*function)(void));
  void passedFuction();
  }
  </code></pre>
  
  <p>In <code>Manager.cpp</code>, I'm trying to call <code>timeCount</code> by</p>
  
  <pre><code>timeCount(&amp;Manager::passedFuction());
  </code></pre>
  
  <p>TimeCount Body:</p>
  
  <pre><code>void Manager::timeCount(void(Manager::*function)(void))
  {
      std::cout &lt;&lt; "It works";
      (*function)(); // here is error
  }
  </code></pre>
  
  <p>ViusalStudio says:</p>
  
  <pre>
  void*Manager::*function)() operand of '*' must be a pointer
  </pre>
  
  <p>How should i correct it?
  The example i was learing by was : <a href="http://www.cplusplus.com/forum/beginner/6596/" rel="nofollow noreferrer">http://www.cplusplus.com/forum/beginner/6596/</a></p>