Possible Duplicate:
# and ## in macros
why the output of second printf is f(1,2) what is the order in which macro is evaluated?
#include <stdio.h>
#define f(a,b) a##b
#define g(a) #a
#define h(a) g(a)
int main()
{
printf("%s\n",h(f(1,2)));
printf("%s\n",g(f(1,2)));
return 0;
}
output 12
f(1,2)
From http://gcc.gnu.org/onlinedocs/cpp/Argument-Prescan.html#Argument-Prescan
Meaning:
h(f(1,2)) -> g(12) -> "12"g(f(1,2)) -> "f(1,2)"