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

前端 未结 1 823
猫巷女王i
猫巷女王i 2021-01-19 11:56

Please tell me the answer with explanation:

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

main(){
  printf(\"%d\",f(100,10));
}
1条回答
  •  再見小時候
    2021-01-19 12:36

    ## 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".

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