I'm trying to think of a clever way (in C) to create an array of strings, along with symbolic names (enum or #define) for the array indices, in one construct for easy maintenance. Something like:
const char *strings[] = { M(STR_YES, "yes"), M(STR_NO, "no"), M(STR_MAYBE, "maybe") };
where the result would be equivalent to:
const char *strings[] = {"yes", "no", "maybe"}; enum indices {STR_YES, STR_NO, STR_MAYBE}; (or #define STR_YES 0, etc)
but I'm drawing a blank for how to construct the M macro in this case.
Any clever ideas?