The y2k at the end is just creating an instance of that enum to work with. You can either assign values of the enum to it or print it out to the screen to get the value. (A similar thing can be done at the end of structs).
1 2 3 4 5 6 7 8 9 10 11
enum months_t { january=1, february, march, april,
may, june, july, august,
september, october, november, december};
int main()
{
months_t y2k;
y2k = january;
cout << y2k << endl; // prints out 1
}
1 2 3 4 5 6 7 8 9 10
enum months_t { january=1, february, march, april,
may, june, july, august,
september, october, november, december}y2k;
int main()
{
y2k = january;
cout << y2k << endl; // prints out 1
}
These 2 examples are basically the same (as far as I know), apart from in the 2nd example y2k is global.