deS*_*gis 16 c concatenation c-preprocessor
的C99标准文档具有相关的##预处理运算的部分下面的例子:
在以下片段中:
Run Code Online (Sandbox Code Playgroud)#define hash_hash # ## # #define mkstr(a) # a #define in_between(a) mkstr(a) #define join(c, d) in_between(c hash_hash d) char p[] = join(x, y); // equivalent to // char p[] = "x ## y";
扩张在不同阶段产生:
Run Code Online (Sandbox Code Playgroud)join(x, y) in_between(x hash_hash y) in_between(x ## y) mkstr(x ## y) "x ## y"
换句话说,扩展hash_hash会产生一个新的令牌,由两个相邻的尖锐符号组成,但这个新令牌不是##运算符.
我不明白为什么hash_hash的替换产生##而不是"##"或"#""#".在双哈希播放之前和之后单个哈希有什么作用?
任何回复都非常感谢.