「C#入門」列挙型Enumのサンプル

例1
enum Days { Sun, Mon, Tue, Wed, Thu, Fri, Sat };

使い方
(int)Days.Sun // 0
(int)Days.Thu // 4

例2
enum Days { Sun = 1, Mon, Tue, Wed, Thu, Fri, Sat };


使い方
(int)Days.Tue // 3
(int)Days.Wed // 4

Software

Posted by arkgame