title: C enum: unknown type name
body: <p>I have this simple code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;time.h&gt;
  
  int main(){
      enum Days { asd=0,Lun,Mar,Mer,Gio,Ven,Sab,Dom };
      Days TheDay;
      time_t ltime;
      struct tm *Tm;
  
      ltime=time(NULL);
      Tm=localtime(&amp;ltime);
      int j = Tm-&gt;tm_wday;
      TheDay = Days(j);
  
      printf("[%d] %d/%d/%d, %d:%d:%d\n",
              TheDay, /* Mon - Sun */
              Tm-&gt;tm_mday,
              Tm-&gt;tm_mon,
              Tm-&gt;tm_year+1900,
              Tm-&gt;tm_hour,
              Tm-&gt;tm_min,
              Tm-&gt;tm_sec);
  }
  </code></pre>
  
  <p>I don't understand why I'm getting this error:</p>
  
  <blockquote>
    <p>try.c:6:5: error: unknown type name ‘Days’</p>
  </blockquote>