You need to associate the macro name with # . This is how assert() works:
#define AA "Hello" #define BB "World" #define PRINT(input_param) printf(#input_param ": %s\n", (input_param)) void main() { PRINT(AA); PRINT(BB); }
It might be clearer if I wrote it like this:
#define PRINT(input_param) printf("%s: %s\n",
Ben jackson
source share