123456789
#include <iostream> using namespace std; int main() { enum numSet {zero, one, two, three}; numSet numA = one; cout << "numA = " << (numA) << endl; }
numA = 1
numA = one
123456789101112131415161718
#include <iostream> #include <map> using namespace std; int main() { enum numSet {zero, one, two, three}; map<numSet, string> names; names[zero] = "zero"; names[one] = "one"; names[two] = "two"; names[three] = "three"; numSet numA = one; cout << "numA = " << names[numA] << endl; }