By the way, adding to the words said earlier: you really can have a default value for the static enum variable. But be careful - this will be 0 (like all other static variables). Consider the following code:
#include <iostream> enum _t_test { test_1 = 1, test_2 = 2, test_3 = 3, }; static enum _t_test t; int main() { using namespace std; cout << "Value of t is: " << t; return 0;
}
It will print 0, but your listings are in the range of 1..3. Therefore, keep this in mind.
Dmitriy Ugnichenko
source share