Pondering the eternal question of "Hobnobs or Rich Tea?",
ha******@hotmail.com finally proclaimed:
what is the difference between Enums and dictionaries...
An enum is used to create a set of related constants, eg.
enum Temp {
BoilingPoint = 100,
MeltingPoint = 0,
}
System.Console.WriteLine("Boiling point is " + Temp.BoilingPoint);
Whereas dictionaries are used to create what is essentially an array of
objects that associates a key with a value, eg.
Dictionary<string, int> people = new Dictionary<string, int>();
people["Tom"] = 23;
people["Dick"] = 50;
people["Harry"] = 29;
System.Console.WriteLine("Dick is " + people["dick"] + " y.o");
The values within a dictionary can also be changed as and when you wish
to change them, and new key/value combinations can also be added at any
time. This is the opposite of enum, where they are essentially read only
once created.
--
Dylan Parry
http://electricfreedom.org -- Where the Music Progressively Rocks!