i want to use enumerations and want to show the exact enumerators as output instead of their integer values.
cout<<"Enter 1st letter of employee type(m,a,d): ";
here if user enters m,the output is 0,i-e integer value of enumerator,how can i make output as manager by entering m.
A few words of advice:
1) Enumerations are constant integers.
2) enums are somewhat structures. The members within an enum are integers. On line 13, 15, and 17, you assign e1 to a constant integer. Why?
3) On line 18, you print an instance of enum. Which member do you want to print? Note that enum instances maybe considered pointless. Also, enumerated values don't require the name of the instance to access it. For example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
int main( )
cout << ENUM_ONE << " " << ENUM_TWO << endl;
In this example, note that there are no instances of ENUMERATIONS, and yet I used ENUM_ONE, and ENUM_TWO.