【问题标题】:What does ## mean in the #define directive in the code here此处代码中#define 指令中的## 是什么意思
【发布时间】:2015-06-17 03:17:40
【问题描述】:

请用解释告诉我答案:

#define f(g,h) g##h

main(){
  printf("%d",f(100,10));
}

【问题讨论】:

标签: c c-preprocessor string-concatenation


【解决方案1】:

## 用于连接## 之前的内容和之后的内容。它用于连接。

您可以查看reference了解详情

在任意两个连续标识符之间的 ## 运算符 replacement-list 对两个标识符运行参数替换 (首先不是宏扩展的),然后连接结果。 此操作称为“连接”或“标记粘贴”。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-09-24
    • 1970-01-01
    • 1970-01-01
    • 2012-02-29
    • 1970-01-01
    • 2011-07-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多