string concatenation with macro [duplicate]
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: Macro for concatenating two strings in C How to concatenate two strings with a macro? I tried this but it does not give correct results: #define CONCAT(string) "start"##string##"end" 回答1: You need to omit the ## : adjacent string literals get concatenated automatically, so this macro is going to concatenate the strings the way you want: #define CONCAT(string) "start"string"end" For two strings: #define CONCAT(a,