GNU cpp allows you to turn macro parameters into strings like this
#define STR(x) #x
Then STR(hi) is replaced by "hi"
But how do you turn a macro (not a macro parameter) into a string?
Say I have a CONSTANT macro with some value, for example.
#define CONSTANT 42
This does not work: STR(CONSTANT) . This gives "CONSTANT" what we do not want.
source share