I have a question about C preprocessor. I have define the macros:
#define num2str(x) str(x)
#define str(x) #x
and I pass a number to a string constant:
const char myString[] = num2str(NUMBER);
When I put for example #define NUMBER 10 works fine.
But I want to put num2str(NUMBER + 10), and the result is "10 + 10" instead of "20".
Is there any way to evaluate the expression NUMBER+10 and obtain "20"?
Is there *any* way..Use something else then C preprocessor. Likem4.#ifexpressions. I don't know of a way to actually have the evaluated results placed into the preprocessor output.