fork download
  1. #include <stdio.h>
  2. union sample {
  3. struct {
  4. char a:1;
  5. char b:1;
  6. char reserved:5;
  7. char last:1;
  8. };
  9. char aggr;
  10. } tmp;
  11. int main(void) {
  12.  
  13. // your code goes here
  14. tmp.aggr = 1;
  15. printf("%x %x %x %x", tmp.a,tmp.b,tmp.last, tmp.aggr);
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0s 4576KB
stdin
Standard input is empty
stdout
ffffffff 0 0 1