title: # and ## in macros
body: <pre><code>  #include &lt;stdio.h&gt;
    #define f(a,b) a##b
    #define g(a)   #a
    #define h(a) g(a)
  
    int main()
    {
      printf("%s\n",h(f(1,2)));
      printf("%s\n",g(f(1,2)));
      return 0;
    }
  </code></pre>
  
  <p>Just by looking at the program one "might" expect the output to be, the same for both the printf statements. But on running the program you get it as: </p>
  
  <pre><code>bash$ ./a.out
  12
  f(1,2)
  bash$
  </code></pre>
  
  <p>Why is it so?</p>