fork download
  1. #include <stdio.h>
  2. #include <stdbool.h>
  3. #include<stdint.h>
  4.  
  5.  
  6. struct a{
  7. union{
  8. struct{bool a:1;};
  9. struct{
  10. uint32_t x:1;
  11. uint32_t y:31;
  12. };
  13. };
  14. };
  15.  
  16. int main(void) {
  17. struct a a={.y=1, .a=true};
  18. printf("%d\n",a.y);
  19. a.y=1;
  20. printf("%d\n",a.y);
  21. return 0;
  22. }
  23.  
Success #stdin #stdout 0s 4168KB
stdin
Standard input is empty
stdout
0
1