Enum with specified values for only some of the members
<p>I have an <code>enum</code> with custom value for only part of the list</p>

<pre><code>public enum MyEnum
{
    FirstValue,
    SecondValue,
    ThirdValue,
    ForthValue = 1,
    FifthValue = 2
}
</code></pre>

<p>When I tried <code>strina name = (MyEnum)2;</code> name was <code>ThirdValue</code>.</p>

<p>But when I changed the <code>enum</code> to</p>

<pre><code>public enum MyEnum
{
    FirstValue = 3,
    SecondValue,
    ThirdValue,
    ForthValue = 1,
    FifthValue = 2
}
</code></pre>

<p>In <code>strina name = (MyEnum)2;</code> name was <code>FifthValue</code>.</p>

<p>Does the compiler (I'm using Visual Studio 2012) initialize custom values only if the first has custom values?</p>

<p>And if <code>ThirdValue</code> got default value 2 in the first example how come there wasn't any error in <code>FifthValue = 2</code>?</p>