Is there a built in function or a way to query the size of an emun typedef?
typedef enum difficultyTypes {
kEasy,
kMedium,
kHard
} difficultyType;
I would like a way to query and have it ( in this case ) return 3.
I could even deal with it returning 2 as the highest value ( 0,1,2 ).
Or am I forced to use another int variable that I statically set when I create the enum?
You may want to reference this post.
kEasy would be 0, kMedium is 1, kHard is 2, and kCount is 3, which is the number of elements you have minus itself.