title: convert va_list to fixed arguments
body: <p>I am writing a thread spawning function of the prototype:</p>
  
  <pre><code>void Thread_create(void (*func)(void*), int argc, ...);
  </code></pre>
  
  <p>I have passed the argument count in so there is no problem determining the length.
  The problem is how do I recast func to a function with argc length and then call it using the arguments that I have?</p>
  
  <p>EDIT: I also have constrained the function to only accept void* arguments (i.e. no need to worry about any other type being passed in)</p>
  
  <p>For example:</p>
  
  <pre><code>void foo(void *bar, void *baz);
  void fooTwo(void *bar, void *baz, void *bam);
  int main(int argc, char *argv[]){
      Thread_create(&amp;foo, 2, (void*)argv[0], (void*)argv[1]); //foo gets called in a new thread with the arguments: argv[0] and argv[1]
      Thread_create(&amp;fooTwo, 3, (void*)argv[0], (void*)argv[1], (void*)argv[2]); //fooTwo gets called in a new thread with the arguments: argv[0] and argv[1] and argv[2]
      return 0;
  }
  </code></pre>
  
  <p>Side note: a solution of the form</p>
  
  <pre><code>Thread_create(void (*func)(void*), int argc, ...); //call with 1 arg
  Thread_create(void (*func)(void*, void*), int argc, ...); //call with 2 args
  Thread_create(void (*func)(void*, void*, void*), int argc, ...); //call with 3 args
  </code></pre>
  
  <p>doesn't work because I cannot pass that information across the thread create library call, whether it may be pthread_create or the windows ThreadCreate function.</p>