title: Convert C++ function pointer to c function pointer
body: <p>I am developing a C++ application using a C library. I have to send a pointer to function to the C library.</p>
  
  <p>This is my class:</p>
  
  <pre><code> class MainWindow : public QMainWindow {  
       Q_OBJECT  
       public:  
       explicit MainWindow(QWidget *parent = 0);  
       private:  
       Ui::MainWindow *ui;
       void f(int*);
  
   private slots:
       void on_btn_clicked(); 
  };
  </code></pre>
  
  <p>This is my on_btn_clicked function:</p>
  
  <pre><code>void MainWindow::on_btn_clicked()
  {
      void (MainWindow::* ptfptr) (int*) = &amp;MainWindow::f;
  
      c_library_function(static_cast&lt;void()(int*)&gt;(ptfptr), NULL);
  
  }
  </code></pre>
  
  <p>The C function should get a pointer to a such function : void f(int*).
  But the code above doesn't work, I cannot succeed to convert my f member function to the desired pointer.</p>
  
  <p>Can anybody please help?</p>