
January 27th, 2002, 04:54 PM
|
|
Contributing User
|
|
Join Date: Dec 2002
Posts: 14,578
  
Time spent in forums: < 1 sec
Reputation Power: 22
|
|
|
enumeration question
Originally posted by : cyblade (cbaker@shivagd.com)I am teaching myself C# and I have run into a problem with enumerations. Below is little program that just displays the constants from the enum listclass test{ enum NumberList :int { NumberZero = 0, NumberOne = 1, NumberTwo = 2, NumberThree = 3, NumberFour = 4, } static void Main() { //Display the value of NumberZero in the console System.Console.WriteLine("Initializing ""NumberZero"" {0}", NumberList.NumberZero); //Display the value of NumberFour in the console System.Console.WriteLine("Initializing ""NumberFour"" {0}", NumberList.NumberFour); }}When this is compiled and run in the cmd line. It displays Initializing "NumberZero" NumberZeroInitializing "NumberFour" NumberFourWhy is it displaying the constant identifier istead of the constant value?
|