title: Can't understand enums in C++, what are they actually ?
body: <p>The last few years I programmed in C#, and I came back to C++ now. In C# enums act something like this: </p>
  
  <pre><code>enum myenum { a,b,c} 
  myenum myinstance = myenum.a;
  </code></pre>
  
  <p>So I can do something like this: </p>
  
  <pre><code>enum myenum { a,b,c}     
  enum myenum2 { a,b,c} 
  
  myenum myinstance = myenum.a;
  </code></pre>
  
  <p>and everything will be fine.</p>
  
  <p>In C++ it doesn't compile, moreover I can't now use <code>a</code> (or <code>b</code> or <code>c</code>) as class name or anything else, it seems like writing : </p>
  
  <pre><code>enum myenum { a, b };
  </code></pre>
  
  <p>Is the same as declaring global int variables :</p>
  
  <pre><code>int a =0, b=1;
  </code></pre>
  
  <p>I don't understand why the developers of C++ choose this type of behavior for enums, and what enums are? is it a type? or just something that the compiler replaces with some int declarations?</p>