two questions
1) how do i cycle through the value of an enum and check each value and print it if if want to? can i do it like i would an array?>
for ex say i have:
enum me {LO, LA, LI};
if i wanted to get LO, could i do cout << me[0] ?
and if i wanted to get all the values in the enum, could i just cycle through it the same i would an array?
2) also i do not firsthand what items i want to add to the enum, that will be done during the program execction since im reading from a file. so how would i do that? does enum have like push() function that i can use during execution to keep pushing items in it?
I think you're confusing enums with arrays. enums are just a bundle of symbolic constants that share a type. For example, a common use is to return an error from a function:
I think your confusion stems from thinking that enum is a type. It's not. It's a type declaration, just like class. The type in your example is 'me'. Iterating over an enum makes no more sense than iterating over a class.
As for me and error_code, they both behave a lot like integer types (they have a couple restrictions, such as having to be explicitly casted to be converted between integer types), so they don't have any members, either. Not that it would make sense for them to have members.