enum type specified : Enum « Data Type « Visual C++ .NET






enum type specified

 

#include "stdafx.h"
using namespace System;

enum class Ordinal : char
{
   zero, one, two, three
};

int main()
{
   char c1 = 3;
   char c2 = 1;
   Ordinal ord1 = safe_cast<Ordinal>(c1);
   Console::WriteLine(ord1.ToString());
}

   
  








Related examples in the same category

1.Create an Enumeration
2.Enum Type
3.enum format
4.Use the bitwise OR operator to combine flags
5.Use the Format method of the Enum class
6.Specify the hex representation when converting enum to string
7.enum class type