Wednesday 29 October 2008

Good Post on Enums as Ints

Highlights differences between enums in C++ and C#. Essential Reading.
http://blogs.msdn.com/peterhal/archive/2005/08/01/446357.aspx

Here's also a useful snippet showing how to iterate through enums in C#, useful if you are populating a ComboBox for example:

foreach (string s in Enum.getValuesOf(enum)) {}

No comments: