title: Casting Between Enums in C#
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1818131/convert-an-enum-to-another-type-of-enum">convert an enum to another type of enum</a>  </p>
  </blockquote>
  
  
  
  <p>When casting between enums of different types, is it possibly to directly cast from one type to the other like so?</p>
  
  <pre><code>LicenseTypes type;
  TypeOfLicense type2;
  
  type2 = (TypeOfLicense)type;
  </code></pre>
  
  <p>Or is it necessary to cast the enum to an int first? The compiler doesn't complain, but I want to make sure I'm not going to get some kind of funky casting exception at runtime.</p>
  
  <p>This may seem like an odd thing to do, but both enums are identical in structure and value. Only the type names differ in this case.</p>