title: Is there a way to access individual bits with a union?
body: <p>I am writing a C program. I want a variable that I can access as a char but I can also access the specific bits of. I was thinking I could use a union like this...</p>
  
  <pre><code>typedef union 
  {
      unsigned char status;
      bit bits[8];
  }DeviceStatus;
  </code></pre>
  
  <p>but the compiler doesn't like this. Apparently you can't use bits in a structure. 
  So what can I do instead?</p>