_____________________________________________
Enumerations of C#.
_____________________________________________
enum Action {Start, Stop, Rewind, Forward};
enum Status {Flunk = 50, Pass = 70, Excel = 90};
Action a = Action.Stop;
if (a != Action.Start)
Console.WriteLine(a + " is " + (int) a); // Prints "Stop is 1"
Console.WriteLine((int) Status.Pass); // Prints 70
Console.WriteLine(Status.Pass); // Prints Pass
____________________________________________________________________
____________________________________________________________________
No comments:
Post a Comment