title: How can I concatenate twice with the C preprocessor and expand a macro as in "arg ## _ ## MACRO"?
body: <p>I am trying to write a program where the names of some functions are dependent on the value of a certain macro variable with a macro like this:</p>
  <pre><code>#define VARIABLE 3
  #define NAME(fun) fun ## _ ## VARIABLE
  
  int NAME(some_function)(int a);
  </code></pre>
  <p>Unfortunately, the macro <code>NAME()</code> turns that into</p>
  <pre><code>int some_function_VARIABLE(int a);
  </code></pre>
  <p>rather than</p>
  <pre><code>int some_function_3(int a);
  </code></pre>
  <p>so this is clearly the wrong way to go about it. Fortunately, the number of different possible values for VARIABLE is small, so I can simply do an <code>#if VARIABLE == n</code> and list all the cases separately, but is there is a clever way to do it?</p>