Created
December 19, 2016 18:47
-
-
Save ellenia/b60b265e60b4f89ed2ef874091e4c061 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace EnumCasting | |
{ | |
enum Status | |
{ | |
Unknown = 0, | |
Active = 1, | |
Inactive = 2 | |
} | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Status statusUnknown = Status.Unknown; | |
Status statusActive = Status.Active; | |
Console.WriteLine("{0}:{1}", statusUnknown, (int)statusUnknown); | |
Console.WriteLine("{0}:{1}", statusActive, (int)statusActive); | |
Console.ReadKey(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment