Shuttleu
2009-08-15 23:12:18
in the tutorial it told me to do this
because Chapters(x) returns an int
so what is the advantage of declaring it using the enum name instead of an int
~shut
#include <iostream>
using namespace std;
int main() {
enum Days {Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday};
int x;
Days DayOff;
cout << "What day would you like off (0-6)? ";
cin >> x;
DayOff = Chapters(x);
if (DayOff == Sunday || DayOff == Saturday)
cout << "\nYou're already off on weekends!\n";
else
cout << "\nOkay, your now off on that day.\n";
return 0;
}but cant DayOfff jst be declared as a int?because Chapters(x) returns an int
so what is the advantage of declaring it using the enum name instead of an int
~shut