title: Cannot convert parameter 1 from 'int (__thiscall A::* *)(void)' to 'int (__cdecl *)(void)'
body: <p>I am getting this error while running this code. Please look in to my code and assist me.</p>
  
  <pre><code>#include "stdafx.h"
  #include &lt;iostream&gt;
  class A
  {
    public:
      void PrintTwoNumbers(int (*numberSource)(void)) 
      {
        int val1= numberSource();     
      }
  
      int overNineThousand(void) 
      {
        return (rand()%1000) + 9001;
      }        
  };
  
  int _tmain(int argc, _TCHAR* argv[])
  { 
    int (A::*fptr) (void) = &amp;A::overNineThousand;
  
    int (A::*fptr1) (void);
    fptr1 = &amp;A::overNineThousand;
  
    A a;
    a.PrintTwoNumbers(&amp;fptr); //-&gt; how to pass here
    getchar();
    return 0; 
  }
  </code></pre>
  
  <p>I am fed up by searching this online, and nobody is giving a perfect solution for this.Can anybody edit this code as working code and help me?</p>