Thursday, December 3, 2009

Using ## and # with define.

Stringize(#)

#define   message_for(a, b)  \
printf(#a " and " #b)
int main()
{
message_for(Carole, Debra);
}

Token pasting (##)
#define f(g,g2) g##g2
main()
{
int var12=100;
printf("%d",f(var,12));
}
Answer:
100

No comments:

Post a Comment