enum color : int { red = -3, green, blue } Console.Write( (int) color.red + ", "); Console.Write( (int) color.green + ", "); Console.Write( (int) color.blue );
int a = 10; int b = 20; int c = 30; enum color: byte { red = a, green = b, blue = c }
namespace CuriousTabConsoleApplication ( class Sample { private enum color : int { red, green, blue } public void fun() { Console.WriteLine(color.red); } } class Program { static void Main(string[ ] args) { // Use enum color here } } }
Comments
Copyright ©CuriousTab. All rights reserved.
sds