title: Why does the ## aka token-pasting operator not work for comments in C and C++?
body: <p>Why does the following error occur?</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  #define concatenate(t1, t2) t1 ## t2 // Concatenate token1 and token2
  
  int main()
  {
      int myVar = 22;
      std::cout &lt;&lt; concatenate(my, Var); // Compiles fine and outputs the value of myVar
  
      concatenate(/, /) So I thought that this would be a comment but this is a compile-time error
      // error: pasting "/" and "/" does not give a valid preprocessing token
  
      return 0;
  }
  </code></pre>
  
  <p>I thought that <code>concatenate(/, /)</code> would tell the preprocessor to replace it with a <code>//</code> and then as it parses further, that entire line would be interpreted as a comment.</p>
  
  <p>What is actually happening in this case?</p>