C# underlying types of enums

Posted by Marlon on Stack Overflow See other posts from Stack Overflow or by Marlon
Published on 2010-04-16T04:13:21Z Indexed on 2010/04/16 4:23 UTC
Read the original article Hit count: 181

Filed under:
|
|
|

What is the point of having

enum SomeEnum : byte // <----
{
  SomeValue = 0x01,
  ...
}

when you have to make a cast just to assign it to the same type of variable as the enums underlying type?

byte b = (byte)SomeEnum.SomeValue;

© Stack Overflow or respective owner

Related posts about c#

Related posts about enum