#if..#endif is no big deal. But from time to
time, we might want to use some features that provided by the CPP.
Concatenation of tokens
All input to CPP are text strings and therefore we can do concatenation of strings like this:
#define NAMEVALUE(x,y,z) x##y(z)
Then by doing
it resolves to
To put stuff as string, we are not using
#x, for example
#define DEBUGPRINT(x) printf("%s = %d\n",#x,x)
will output something like
x = 3
__FILE__resolves into the filename of the source code file.
__LINE__resolves into the source line number
__TIME__resolves into the compile date and time
__func__resolves into the function name, only in C99