C preprocessor # and ## operators

前端 未结 1 967
执念已碎
执念已碎 2020-12-05 05:29

The C99 standard document has the following example in the section related to the ## preprocessing operator:

In the following fragment:



        
相关标签:
1条回答
  • 2020-12-05 06:08

    The ## in # ## # acts like an escape sequence in this expression. It concatenates the leftmost and the rightmost # to finally produce the token ##. Simply defining the macro as ## would cause an error since the concatenation operator expects two operands.

    0 讨论(0)
提交回复
热议问题