say I have this:
enum ABC {a,b,c}
and I have int val =2.... how can I convert the integer value to the correct enum member in ABC?
I tried (ABC) val but it didnt work:D I dunno what I'm doing, someone help me
Printable View
say I have this:
enum ABC {a,b,c}
and I have int val =2.... how can I convert the integer value to the correct enum member in ABC?
I tried (ABC) val but it didnt work:D I dunno what I'm doing, someone help me
PHP Code:enum ABC {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}
PHP Code:Console.WriteLine("Give me a number 0-25 and I'll give you the letter: ");
int x=Convert.ToInt16(Console.ReadLine());
ABC e=(ABC)x;
Console.WriteLine(Convert.ToInt16(e)+"="+e.ToString());