How can I use another macro in a string macro in C?
I have this:
#define MAX_OPERATION_COUNT 10
#define MSG_TOO_MANY_OPERATIONS "Too many operations! Only the first 10 were applied."
But I would like the second macro to use the value of the first one instead. In Java for instance, I would have had something like:
public static final int MAX_OPERATION_COUNT = 10;
public static final String MSG_TOO_MANY_OPERATIONS = "Too many operations! Only the first " + MAX_OPERATION_COUNT + " were applied.";
Is there a way to do something similar in C?
Edit: The solution to this turned out to be very similar to the solution to this question, but I believe the problem itself is quite different and should be treated separately.