title: Can you printf value from a void * in C
body: <p>Ok, I'm trying to do this, but it isn't working becuase I'm not dereferencing the pointer... is there a way to do it without making a switch statement for the type?</p>
  
  <pre><code>typedef struct
  {
      char *ascii_fmtstr;
      int len;
      int (*deserializer)(void *in, const char *ascii);
      int (*serializer)(const void *in, char *ascii);
  } FORMAT;
  
  const FORMAT formats[]=
  {
      {"%d\n",    2/2}        //Int
      ,{"%s\n",   STRSIZE/2}  //String
      ,{"%.4f\n", 4/2}        //Float
      ,{"%lld",   4/2}        //Long-Long
      ,{"%s\n",   STRSIZE/2}  //Time
  };
  
  typedef struct {
      int fmtindex;
      void * vp;
  } JUNK;
  
  float f = 5.0f;
  int i=1;
  char foo[]="bar";
  
  JUNK j[] = {
       {2, &amp;f}
       ,{0, &amp;i}
       ,{1, foo}};
  
  void dump(void)
  {
      int i;
      for(i=0;i&lt;2;i++)
          printf(formats[j[i].fmtindex].ascii_fmtstr, j[i].vp);
  
  }
  </code></pre>