Suppose I have an enum with arbitrary increments between contents. Like so:
typedef enum {this=2,that=5,whoa=6}example;
Now I want to enumerate through them. If the contents were incremented by 1 for each item, then this would be easy with a simple for
loop. I could still use a for
but test for each option in example
enum before proceeding with an operation, but that seems rather inefficient. Is there a standard way of enumerating through an enum?