title: Variable arguments in C, how to get values with a generic type?
body: <p>I'm trying to use C stdarg.h lib, with a generic type.
  The type int, is my generic type > to understand it, please, hold reading.
  So, my problem is:</p>
  
  <p>I have a function that accept variable number of arguments. like</p>
  
  <pre><code>void function (int paramN, ...);</code></pre>
  
  <p>In my program, there are no way to know, which is the type of variable arguments, it can be a char, an array, an int, an short, an function point, etc... like</p>
  
  <pre><code>function (paramN, "Hey, I'm a string", 1, function_pint, array, -1); // -1 is a sentinel.</code></pre>
  
  <p>So, I think that, an int, is 32bits, in a x86(32bits) system, this will hold all address of memory. So, if I get all arguments with a int, it will not be a problem, for example, "Hey, I'm a string" the address of this string, fit normally in a 32bits variable, so, i need only to make a cast.
  <br/></p>
  
  <p>Im right?<br />
  Can I do it?<br />
  Note: I don't want to make my function like printf (this solution, don't fit in this case ok?)</p>
  
  <p>Thanks for all answer.<br />
  And sorry for my bad english.</p>