title: Cast pointer to member function to normal pointer
body: <p>Currently I have a class of this kind, shortened for simplicity:</p>
  
  <pre><code>class MyClass {
      public: 
          MyClass();
          void* someFunc(void* param);
  }
  </code></pre>
  
  <p>Now I need to call a function of this kind (not member of any class and which I unfortunately <strong>cannot change</strong>) but which I need to call anyway:</p>
  
  <pre><code>void secondFunc(int a, int b, void *(*pCallback)(void*));
  </code></pre>
  
  <p>Now I need to pass the address of someFunc of an instance.</p>
  
  <p>A not working sample:</p>
  
  <pre><code>MyClass demoInstance;
  // some other calls
  secondFunc( 1, 2, demoInstance::someFunc() );
  </code></pre>
  
  <p>I've tried also with casts like:</p>
  
  <pre><code>(void* (*)(void*)) demoInstance::someFunc;
  reinterpret_cast&lt;(void* (*)(void*))&gt;(demoInstance::someFunc);
  </code></pre>
  
  <p>How can I call this function with a class' member function as parameter so that this one can use it as callback?</p>
  
  <p>Any idea or remark is appreciated. Thanks and regards
  tobias</p>