title: C nested macros
body: <p>Why in one case nested macros works while in the other does not?</p>
  
  <p>Case 1:</p>
  
  <pre><code>#define name(val) #val
  #define name2(front, back) name(front ## back)
  ...
  
  printf("%s\n", name2(foo, bar));   // foobar
  </code></pre>
  
  <p>Case 2:</p>
  
  <pre><code>#define paste(front, back) front ## back
  #define name(val) #val
  #define name2(front, back) name(paste(front, back))
  ...
  
  
  printf("%s\n", name2(foo, bar));   // paste(foo, bar)
  </code></pre>