I’m interested in doing something like an enum but where the increments aren’t always one, sort of like this:
typedef enum{this=0,that=3,something=5}example;
I am wondering what is the best way to do something like this, as I gather the above is either not possible or not advised. Basically I want to use kConstantNames that refer to specific integer values… should i just use a #define statement instead?
That’s allowable, quite normal, and definitely better than
#define.Minor nit-pick:
#defineisn’t a statement. It’s a preprocessor construct that is expanded out before the compiler proper even sees it.