When I use this code:
#include <stdio.h>
#define STR(x) #x
int main(void)
{
printf(__FILE__ STR(__LINE__) "hello!\n");
return 0;
}
it prints
hello.c__LINE__hello!
but when I use this:
#include <stdio.h>
#define STR(x) VAL(x)
#define VAL(x) #x
int main(void)
{
printf(__FILE__ STR(__LINE__) "hello!\n");
return 0;
}
it prints
hello.c7hello!
what's the difference between
#define STR(x) #x
and
#define STR(x) VAL(x)
#define VAL(x) #x