Expand macros inside quoted string [duplicate]
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: C Macros to create strings I have a function which accepts one argument of type char* , like f("string"); If the string argument is defined by-the-fly in the function call, how can macros be expanded within the string body? For example: #define COLOR #00ff00 f("abc COLOR"); would be equivalent to f("abc #00ff00"); but instead the expansion is not performed, and the function receives literally abc COLOR . In