title: How to use the token pasting operator with a variable number of arguments?
body: <p>I thought of having a generic version of <code>#define concatenate(a, b, c) a ## b ## c</code></p>
  
  <p>I tried it like this:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  #define concatenate(arg1, ...) arg1 ## __VA_ARGS__
  
  int main()
  {
      int dob = 121201;
      printf("%d", concatenate(d, o, b));
  
      return 0;
  }
  
  </code></pre>
  
  <p>I also tried many other ways:</p>
  
  <p><code>#define concatenate(arg1, ...) arg1 ## ##__VA_ARGS__</code></p>
  
  <p><code>#define concatenate(...) ## ##__VA_ARGS__</code></p>
  
  <p><code>#define concatenate(...) ##__VA_ARGS__</code></p>
  
  <p><code>#define concatenate(arg1, ...) arg1 ## ...</code></p>
  
  <p><code>#define concatenate(arg1, ...) arg1 ## concatenate(##__VA_ARGS__)</code></p>
  
  <p>Alas, all my attempts failed. I was wondering if it is even possible to do this in any way?</p>