title: passing a single integer to a multithread function in C++
body: <p>I want to call a function with multiple threads, and I only need to pass a single integer to that function (the thread id, so if it is accessible I need no value to pass).</p>
  <p>How should I do this?</p>
  <p>for example like:</p>
  <pre><code>for(int i=0; i &lt; numberOfThread; i++ ){
        pthread_create(&amp;threads[i], NULL, multichaper, &amp;td[i]);
  }
  </code></pre>
  <p>in which multichaper is my function and threadID is an integer.</p>
  <p>Update: I marked the answer from user3286661 as the right answer and that worked for me, if you want a more detailed answer you can check my own solution to this question in answers.</p>