What does ## mean in the #define directive in the code here

杀马特。学长 韩版系。学妹 提交于 2019-12-02 02:03:16

问题


Please tell me the answer with explanation:

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

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

回答1:


## is used to concatenate whatever is before the ## with whatever is after it. It is used for concatenation.

You can check the reference for details

A ## operator between any two successive identifiers in the replacement-list runs parameter replacement on the two identifiers (which are not macro-expanded first) and then concatenates the result. This operation is called "concatenation" or "token pasting".



来源:https://stackoverflow.com/questions/29577775/what-does-mean-in-the-define-directive-in-the-code-here

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!