enum F
{
// Give each element a custom value
Foo = 1, Bar = 2, Baz = 3, Quux = 0
}
//Default for an enum is 0.
//For example:
using System;
public class Program
{
enum EnumExample
{
one = 1,
two = 2
}
public void Main()
{
var e = new EnumExample();
if (e == EnumExample.one)
Console.WriteLine("need to assign to one to get here");
if(e == 0)
Console.WriteLine("Will get here since the default is 0");
}
}
//Output:
//Will get here since the default is 0