Showing posts with label Enum in c#. Show all posts
Showing posts with label Enum in c#. Show all posts

Thursday, January 17, 2008

Enums - some more basics

Consider enum below
enum test:int
{
a,
b,
c = 5,
d
}

What will the following code display

static void Main(string[] args)
{
Console.WriteLine((int)test.a);
Console.WriteLine((int)test.b);
Console.WriteLine((int)test.c);
Console.WriteLine((int)test.d);
Console.ReadKey();
}