title: Enum type variable declarations in C
body: <p>I declared this enum type in C : </p>
  
  <pre><code>enum months { JAN = 1, FEB, MAR, APR, MAY, JUN,
                JUL, AUG, SEP, OCT, NOV, DEC } ;
  </code></pre>
  
  <p>When I try to create a variable of type months in <code>main()</code> with:</p>
  
  <pre><code>months month;
  </code></pre>
  
  <p>It gives the following error: </p>
  
  <blockquote>
    <p>unknown type 'months'</p>
  </blockquote>
  
  <p>But when I declare it like this: </p>
  
  <pre><code>enum months { JAN = 1, FEB, MAR, APR, MAY, JUN,
                JUL, AUG, SEP, OCT, NOV, DEC } month;
  </code></pre>
  
  <p>It works fine. I thought both ways were valid, so why is there an error? </p>