title: Signed bit field represetation
body: <p>I made a bit field with a field sized 1 bit, and used <code>int</code> instead of <code>unsigned</code>. Later on when i tried to check the value of the field i found that the value was -1. 
  I used this code to check the binary represantation and the value of my bit field:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  union {
      struct {
          int bit:1;
      } field;
      int rep;
  } n;
  
  int main() {
  
  int c, k;
  n.field.bit=1;
   for (c = 31; c &gt;= 0; c--)
    {
      k = n.rep &gt;&gt; c;
  
      if (k &amp; 1)
        printf("1");
      else
        printf("0");
    }
  
    printf("\n %d \n", n.field.bit);
  
  return 0;
  }
  </code></pre>
  
  <p>the output was:
  00000000000000000000000000000001</p>
  
  <p>-1 </p>
  
  <p>In that case, why is the value of my bit field is -1 and is it always be a negative number when i use signed int instead of unsigned ?</p>