I am very new to C++ and am wondering what the difference between the two bits of code below is,in terms of what it's really doing and if I should be using one, rather than the other. They both compile fine with no error messages, and have seen examples of both of these used in different circumstances.
enum Days {Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday};
Days DayOff;
int x;
cin >> x;
DayOff = (Days) x;
enum Days {Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday};
Days DayOff;
int x;
cin >> x;
DayOff = Days (x);