title: array of type void
body: <p>plain C have nice feature - void type pointers, which can be used as pointer to any data type.<br>
  But, assume I have following struct:</p>
  
  <pre><code>
  struct token {
      int type;
      void *value;
  };
  </code></pre>
  
  <p>where value field may point to char array, or to int, or something else.<br>
  So when allocating new instance of this struct, I need:</p>
  
  <p>1) allocate memory for this struct;<br>
  2) allocate memory for value and assign it to value field.<br></p>
  
  <p>My question is - is there ways to declare "<b>array</b> of type void", which can be casted to any another type like void pointer?<br></p>
  
  <p>All I want is to use "flexible member array" (described in 6.7.2.1 of C99 standard) with ability to casting to any type.<br></p>
  
  <p>Something like this:</p>
  
  <pre><code>
  struct token {
      int type;
      void value[];
  };
  
  struct token *p = malloc(sizeof(struct token) + value_size);
  memcpy(p->value, val, value_size);
  ...
  char *ptr = token->value;
  
  </code></pre>
  
  <p>I suppose declaring token->value as char or int array and casting to needed type later will do this work, but can be very confusing for someone who will read this code later.</p>