title: Converting typeof to string
body: <p>Is there a way to convert gcc's <code>typeof</code> extension to a string, for example:</p>
  
  <pre><code>#define printType(a) printf("%s", #typeof(a))
  </code></pre>
  
  <p>So that I can do:</p>
  
  <pre><code>int a = 4;
  printf("Type of a is: ");
  printType(a);
  </code></pre>
  
  <p>And get the output of:</p>
  
  <pre class="lang-none prettyprint-override"><code>Type of a is: int
  </code></pre>
  
  <p>A possible use of this would be as follows:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  #define indirect_print(a) print_##typeof(a)(a)
  
  void print_int(int *i) {
      printf("%d", *i);
  }
  
  void print_char(char *c) {
      printf("%c", *c);
  }
  
  int main(void) {
      char C = 'C';
      int I = 100;
  
      {
          char *a = &amp;C;
          indirect_print(a);
      }
  
      {
          int *a = &amp;I;
          indirect_print(a);
      }
  
      return 0;
  }
  </code></pre>
  
  <p>If possible, it should work for all types including structures and unions, without relying on adding every type to a list manually.</p>