If have an enumeration like so:
typedef enum {
ValueOne = /* some arbitrary number, NOT necessarily 0 */,
ValueTwo = /* another number, NOT necessarily consecutive */
} MyEnumeration;
I was wondering if there is any way to get an array out of it and access a value at a specific index without doing this:
int array[2] = {ValueOne, ValueTwo};
MyEnumeration value = array[provided_index];
My problem is that in my project, the enumerations have 10-15 values, and I'd rather not create an array out of each one of them.
[Edit]: I can see how this would not be possible since typedef and enum aren't tied together at all, but I figured it wouldn't hurt to ask in case I was missing something.