O'Reilly logo

C# Primer Plus by Klaus Michelsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Conversions

Only explicit conversions are possible for converting to (from) any integer type (not char, though) from (to) an enum type by using the cast operator (<Type>). However, the number 0 (zero) is an exception. It can be implicitly converted to an enumerator type; the reason is displayed in the Tip box.

It is also possible to explicitly convert one enumerator type to another enumerator type.

Tip

The only numeric value that can be implicitly converted to an enumerator type is 0.

To reset or initialize an enumeration variable is the equivalent of assigning it the first member of the enumeration. If the first member of any enumeration is always ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required