title: C : assign negative value to enum?
body: <h3>Background</h3>
  
  <p>I am trying to assign -1 to an enum variable as shown below:</p>
  
  <pre><code>typedef enum test {
          first,
          second,
  }soc_ctr_type_t 
  
  soc_ctr_type_t ctype;
  
  ...
  
  switch(type){
     case 1:
         ctype = first;
     break;
  
     case 2:
        ctype = second;
     break;
  
     default:
        ctype = -1;
  }
  </code></pre>
  
  <p>If <code>type</code> is the default case, <code>ctype</code> should become -1, but it's not.
  When I use <code>printf</code> to debug, <code>ctype</code> is 255.</p>
  
  <h3>Question</h3>
  
  <p>Why does <code>ctype</code> become 255 instead of -1?</p>