Learn C# - How To Get Int Value from Enum?
Getting an int value from enum can be challenging in C#. However, it can easily be done by using the following code:
1 2 3 4 5 6 |
public enum Months { Numbers = 23, MonthType = 3 } int abc = (int)Months.Number; |
The above code stores int value of Months enum into abc. We…