fork download
  1. #include <stdio.h>
  2.  
  3. typedef union {
  4. char valor;
  5. struct {
  6. unsigned char a : 1;
  7. unsigned char b : 1;
  8. unsigned char c : 1;
  9. unsigned char d : 1;
  10. unsigned char e : 1;
  11. unsigned char f : 1;
  12. unsigned char g : 1;
  13. unsigned char : 1;
  14. } bits;
  15. } Tipo;
  16.  
  17. int main(void) {
  18. Tipo x = { .valor = 87 };
  19. printf("%d %d %d %d %d %d %d", x.bits.a, x.bits.b, x.bits.c, x.bits.d, x.bits.e, x.bits.f, x.bits.g);
  20. }
  21.  
  22. //https://pt.stackoverflow.com/q/178733/101
Success #stdin #stdout 0s 4440KB
stdin
Standard input is empty
stdout
1 1 1 0 1 0 1