Advanced Macro Tricks
In addition to simple substitution, the preprocessor can also perform a bit of extra work on macro arguments, such as turning them into strings or pasting them together.
Pasting Tokens
Each argument passed to a macro is a token, and sometimes it might be
expedient to paste arguments together to form a new token. This could come
in handy if you have a complicated structure and you'd like to debug your program by printing out different fields. Instead of writing out the whole
structure each time, you might use a macro to pass in the field of the structure to print.
To paste tokens in a macro, use ## between the two things to paste together.
For instance
#define BUILD_FIELD(field) my_struct.inner_struct.union_a.##field
Now, when used with a particular field name, it will expand to something like
my_struct.inner_struct.union_a.field1
The tokens are literally pasted together.