title: the right way use bit field print number in binary
body: <p>here is the code I found using bit field print int number in binary, but I also read that bit field only using <code>unsigned</code>, <code>int</code> for its type, so, is it legal for this code using <code>char</code> type ?
  </p>
  
  <pre><code>struct bits
  {
      unsigned char ch1 : 1;//01
      unsigned char ch2 : 1;
      unsigned char ch3 : 1;
      unsigned char ch4 : 1;
      unsigned char ch5 : 1;
      unsigned char ch6 : 1;
      unsigned char ch7 : 1;
      unsigned char ch8 : 1;
  };
  
  void main()
  {
      int data = -1;
      int length = 4;
  
      struct bits *p = &amp;data;
  
      while (length--)
      {
          printf("%d%d%d%d %d%d%d%d ",
              (p + length)-&gt;ch8,
              (p + length)-&gt;ch7,
              (p + length)-&gt;ch6,
              (p + length)-&gt;ch5,
              (p + length)-&gt;ch4,
              (p + length)-&gt;ch3,
              (p + length)-&gt;ch2,
              (p + length)-&gt;ch1
              );
      }
      system("pause");
  }
  </code></pre>