Link to home
Start Free TrialLog in
Avatar of zordes
zordesFlag for Switzerland

asked on

Get number of element in an enum

I need to determine the number of elements in an enumaration.
Avatar of johnnash1180
johnnash1180
Flag of India image

enum enumDigits {ZERO, ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE};

int totalDigits = enumDigits.values().length;

John Nash.
Avatar of zordes

ASKER

Sorry
I have selected the wrong zone. In the Question wizzard I didn't spot the .NET.
I am using the pure C++ with WIN32.
How can I changes zones?
ASKER CERTIFIED SOLUTION
Avatar of johnnash1180
johnnash1180
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of zordes

ASKER

Thanks
I have expected something like this.