String Constantization Operator ()
#include <stdio.h>
#define message\_for(a, b) \
printf(#a " and " #b ": We love you!\n")
int main(void) {
message_for(Carole, Debra);
return 0;
}
When the above code is compiled and executed, it produces the following result:
Carole and Debra: We love you!
When you need to convert a macro parameter to a string constant, use the string constant operator #
Comments