fork(1) download
  1. #include <stdio.h>
  2.  
  3. typedef struct{
  4. unsigned v : 1;
  5. } ONETWO;
  6.  
  7. int get(ONETWO x){
  8. return x.v+1;
  9. }
  10. int main(void) {
  11. ONETWO x={0};
  12.  
  13. printf("%d\n",get(x));
  14. x.v++;
  15. printf("%d\n",get(x));
  16. x.v++;
  17. printf("%d\n",get(x));
  18. --x.v;
  19. printf("%d\n",get(x));
  20. x.v--;
  21. printf("%d\n",get(x));
  22. --x.v;
  23.  
  24. printf("%d\n",get(x));
  25. return 0;
  26. }
  27.  
Success #stdin #stdout 0s 4192KB
stdin
Standard input is empty
stdout
1
2
1
2
1
2