title: Invalid conversion from `void *` to `void (*)(void*)`
body: <p>So I'm currently using, or at least trying to write a program that makes use of <a href="https://github.com/Pithikos/C-Thread-Pool" rel="nofollow noreferrer">this C pthread threadpool library.</a></p>
  
  <p>Of note is the following function in <code>thpool.h</code>:</p>
  
  <pre><code>int thpool_add_work(threadpool, void (*function_p)(void*), void* arg_p);
  </code></pre>
  
  <p>My code which I'm trying to add a work to is as follows:</p>
  
  <pre><code>int testpool(string (&amp;input)[3]){
      // Pass three strings to it. Which we will end up displaying.
      cout &lt;&lt; input[0].c_str() &lt;&lt; endl;
      cout &lt;&lt; input[1].c_str() &lt;&lt; endl;
      cout &lt;&lt; input[2].c_str() &lt;&lt; endl;
      return 1;
  }
  
  string input[3];
  input[1] = "Hello";
  input[2] = "Test";
  input[3] = "Happy.";
  thpool_add_work(thpool, (void*)testpool, (void*)input);
  </code></pre>
  
  <p>This gives me the following error: </p>
  
  <blockquote>
  <pre><code>main.cpp: In function ‘int main(int, char**)’:
  main.cpp:167:55: error: invalid conversion from ‘void*’ to ‘void (*)(void*)’ [-fpermissive]
    thpool_add_work(thpool, (void*)testpool, (void*)input);
                                                         ^
  
  In file included from main.cpp:29:0:
  thpool.h:67:5: note: initializing argument 2 of ‘int thpool_add_work(threadpool, void (*)(void*), void*)’
   int thpool_add_work(threadpool, void (*function_p)(void*), void* arg_p);
  </code></pre>
  </blockquote>
  
  <p>I'm certain that I'm simply calling the function wrong or something, but can't figure out how exactly to do it properly. So how do I fix it?</p>
  
  <p><strong>Edit/Update:</strong></p>
  
  <p>I changed the function to do the following:</p>
  
  <pre><code>void testpool(void*){
      // Pass three strings to it. Which we will end up displaying.
      cout &lt;&lt; "Hellooooo." &lt;&lt; endl;
  }
  </code></pre>
  
  <p>And this works fine. Now question is how do I pass this an array of strings so I can access the data as arguments?</p>