title: pthread function from a class
body: <p>Let's say I have a class such as</p>
  <pre><code>class c { 
      // ...
      void *print(void *){ cout &lt;&lt; &quot;Hello&quot;; }
  }
  </code></pre>
  <p>And then I have a vector of c</p>
  <pre><code>vector&lt;c&gt; classes; pthread_t t1;
  classes.push_back(c());
  classes.push_back(c());
  </code></pre>
  <p>Now, I want to create a thread on <code>c.print();</code></p>
  <p>And the following is giving me the problem below:</p>
  <p><code>pthread_create(&amp;t1, NULL, &amp;c[0].print, NULL);</code></p>
  <blockquote>
  <p>Error Output: cannot convert ‘void* (tree_item::*)(void*)’ to ‘void*
  (*)(void*)’  for argument ‘3’ to ‘int pthread_create(pthread_t*, const
  pthread_attr_t*, void* (*)(void*), void*)’</p>
  </blockquote>