Get underlying type

   
   
using System;

enum EmpType : byte {
    Manager = 10,
    Grunt = 1,
    Contractor = 100,
    VP = 9
}

class Program {
    static void Main(string[] args) {
        EmpType fred;
        fred = EmpType.VP;

        Console.WriteLine(Enum.GetUnderlyingType(typeof(EmpType)));

    }
}

   
    
     


This entry was posted in Data Types. Bookmark the permalink.