title: 'void *' to 'void (*) (bool)' Errors with pointers compiling files in c with a c ++ compiler
body: <p>First of all, thank you to whoever is reading and to whom you can respond.</p>
  
  <p>This part of code, is part of an interface library gui, totally written in c.</p>
  
  <p>But I'm tempted to compile these written files in c, with a c ++ compiler to be able to integrate into a program I'm doing with wxwidgets.</p>
  
  <p>Within the c files, I have several function calls that have as arguments, pointers to other functions. </p>
  
  <pre><code> typedef struct {
        void (*fchd_ptr)(bool);   
        uint16_t xpos;         
        uint16_t ypos;          
          ...
          ...
  }BUTTON_t;
  
  void BT_SetHandler(BUTTON_t* ptr, void* fchd_ptr)
  {
      if (ptr == NULL)
          return;
  
      ptr-&gt;fchd_ptr =  fchd_ptr;  // OK in C, ERROR In C++
  }
  </code></pre>
  
  <p>When I try to compile in C ++, I get this error.</p>
  
  <pre><code>ptr-&gt; fkt_ptr = fkt_ptr;
  // error: invalid conversion from 'void *' to 'void (*) (bool)' [-fpermissive]
  </code></pre>
  
  <p>If I cast an explicit cast.</p>
  
  <pre><code>ptr-&gt; fkt_ptr = (bool *) fkt_ptr;
  // error: can not convert 'bool *' to 'void (*) (bool)' in assignment
  </code></pre>
  
  <p>Any help, and explanation how to solve it will be welcome.</p>