Enum
#include <stdafx.h>
#include <iostream>
#include <string>
using namespace std;
/* Enum data type is used to declare variables that can have one of the values enclosed within the braces(known as enumeration constants.) */
enum MyEnum { /*Defines enum type. */
SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY /* These are Enum constants.*/
};
int main()
{
MyEnum e; /* Defines an enum variable. */
e=MONDAY;
if(e==MONDAY)
{
cout<< "Today is Monday";
}
return 0;
}
Output:
Today is Monday