I declare a new DAY type using an enumeration, and then declare two variables from it day1 and day2, then I should have seen values from 0 to 6 when I used them uninitialized, since the values were between 0 and 6 in the list of enumerations, but I I get these values instead of -858993460.
Can you explain to me why I get these values instead of 0-6?
#include<iostream> using namespace std; int main() { enum DAY{SAT,SUN,MON,TUE,WED,THU,FRI}; DAY day1,day2; cout<<int(day1)<<endl<<day1<<endl; cout<<int(day2)<<endl<<day2<<endl; system("pause"); return 0; }
Felix source share