title: Nested Macro : Order of Expansion
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/8062271/why-i-am-not-getting-the-expected-output-in-the-following-c-programme">Why i am not getting the expected output in the following c programme?</a>  </p>
  </blockquote>
  
  
  
  <p>i am having a doubt in order of evaluation of macros.like for the following code i am not able to understand the ouput:</p>
  
  <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>Output</p>
  
  <pre><code>12
  f(1,2)
  </code></pre>
  
  <p>why not f is getting expanded first before g in the second printf ?</p>