You can find the same article in my dotnetspider article
from the following link
Enumerations in C#
Enumerations are a special kind of data type. Enumerations contain a list of named constants.
They can make code more readable, as they allow you to reference constants by using a name instead of the literal value.
In C#, enumerations are declared by using the
enum keyword.
Enumerations can be declared as
byte, sbyte, short, ushort, int, uint, long and ulong.
By default, enumerations are defined as
int.
enum animal
{
Dog,
Cat,
Fish,
Bird
}
A comma must separate each member in the enumeration.
If values for the enumeration members are not explicitly defined, the first member defaults to 0.
In the
Animal example, the Dog member equates to 0; the Cat equates to 1, and so on.
Members can be initialized to constant values if needed.
enum Animal
{
Dog = 3,
Cat,
Fish,
Bird
}
Here, members are initialized starting at 3.
Cat equals 4 and so on.
In reality each member can be initialized to any constant expression.
The two preceding examples do not define an underlying type for the enumeration.
Animal,
in this case, defaults to an
integer enumeration.
Animal can be defined as a
long , as in the following example.
enum Animal : long
{
Dog = 3,
Cat,
Fish,
Bird
}
Here I explained basics of enumerations.
For more information please go through the following links.
http://www.codeproject.com/KB/cs/LocalizingEnums.aspx
http://www.softsteel.co.uk/tutorials/cSharp/lesson7.html