Hello, in my C program I need to define a large number of max/min/default values. Here is the long way:
#define MIN_X 15
#define MAX_X 75
#define DFLT_X 20
#define MIN_Y 0
#define MAX_Y 1024
#define DFLT_Y 200
... and so on for a few hundred parameters.
This would be much more readable/maintainable if I could do this in tabular form, and I'm wondering if there is a clever macro that can help, and would expand to the above, such as:
or even this, if it is easier:
#define DEFINE_MULTIPLE(MIN_X, 15, MAX_X, 75, DFLT_X, 20)
#define DEFINE_MULTIPLE(MIN_Y, 0, MAX_Y, 1024, DFLT_Y, 200)
Either of these will result in much easier-to-read code. In short, is there any way to define a macro that will expand to multiple #define macros?