Simplify the call and use the compiler preprocessor to find out what happens:
#define q(k)main(){puts(#k"hello("#k")");} q(argument)
Running gcc -E , which gives you:
main(){puts("argument""hello(""argument"")");}
As you can see, what happens is that the q macro argument is converted to a string (because is is used as #k - this is sometimes called a "string"). There is no other magic here.
source share