So I need/want a C/C++ macro function that takes a #define
constant and converts it into a hex string. I know that #
does it but not exactly what I want.
Here's basically what I have now:
#define SHIFT 2
#define CONSTANT 0x00000001 << SHIFT
#define _MAKE_HEX(value) #value
#define MAKE_HEX(value) _MAKE_HEX(value)
const char* String = MAKE_HEX(CONSTANT);
The result is not the final value and it just shows the result of the text substitution. How can I fix this?