-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEnum_class.cpp
38 lines (34 loc) · 1022 Bytes
/
Enum_class.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
* project : https://github.com/Robin005cr/Professional_CPP
* file name : Enum_class.cpp
* author : Robin CR
* mail id : [email protected]
* LinkedIn : https://www.linkedin.com/in/robin-cr/
* portfolio : https://robin005cr.github.io/
*
* Note : If any mistakes, errors, or inconsistencies are found in the code, please feel free to mail me.
* Suggestions for improvements or better methods are always welcome and appreciated.
* I value constructive feedback and aim to continuously improve the quality of the work.
*
*/
#include <iostream>
using namespace std;
enum class days { SUN, MON = 8, TUE };
int main()
{
days Week1day = days::SUN;
switch (Week1day)
{
case days::SUN:
cout << "This is Sunday";
break;
case days::MON:
cout << "This is Monday";
break;
case days::TUE:
cout << "This is Tuesday";
break;
}
cout << static_cast<int>(Week1day); // static_cast is required to print the integer value.
return 0;
}