title: C preprocessor # and ## operators
body: <p>The <a href="http://www.open-std.org/JTC1/sc22/wg14/www/docs/n1124.pdf">C99 standard document</a> has the following example in the section related to the ## preprocessing operator:</p>
  
  <blockquote>
    <p>In the following fragment:</p>
  
  <pre><code>#define hash_hash # ## #
  #define mkstr(a) # a
  #define in_between(a) mkstr(a)
  #define join(c, d) in_between(c hash_hash d)
  
  char p[] = join(x, y); // equivalent to
                         // char p[] = "x ## y";
  </code></pre>
    
    <p>The expansion produces, at various
    stages:</p>
  
  <pre><code>join(x, y)
  in_between(x hash_hash y)
  in_between(x ## y)
  mkstr(x ## y)
  "x ## y"
  </code></pre>
    
    <p>In other words, expanding hash_hash
    produces a new token, consisting of
    two adjacent sharp signs, but this new
    token is not the ## operator.</p>
  </blockquote>
  
  <p>I don't understand why the substitution of hash_hash produces ## and not "##" or "#""#". What role are the single hashes before and after the double hash playing?</p>
  
  <p>Any responses greatly appreciated.</p>