Enumeration in C#
กัญจน์ จรัสโรจนพร 650710213
การประกาศตัวแปร Enumeration
// C# program to illustrate the enums
// with their default values
using System;
namespace ConsoleApplication1 {
// making an enumerator 'month'
enum month
{
// following are the data members
jan,
feb,
mar,
apr,
may
}
class Program {
// Main Method
static void Main(string[] args)
{
// getting the integer values of data members..
Console.WriteLine("The value of jan in month " +
"enum is " + (int)month.jan);
}
}
}ค่าสมาชิกของ Enumeration
การกำหนดชนิดข้อมูลสมาชิกของ Enumeration
แหล่งที่มา
Last updated
