fork(2) download
  1. #include<stdio.h>
  2.  
  3. int a, b, c = 0;
  4. void prtFun(void);
  5. main()
  6. {
  7. static int a = 1; /* Line 1 */
  8. prtFun();
  9. a += 1;
  10. prtFun();
  11. printf("\n %d %d", a, b);
  12. }
  13.  
  14. void prtFun(void)
  15. {
  16. static int a = 2; /* Line 2 */
  17. int b = 1;
  18. //a += ++b;
  19. a=a+++b;
  20. printf("\n %d %d", a, b);
  21. }
  22.  
Success #stdin #stdout 0s 5504KB
stdin
Standard input is empty
stdout
 3 1
 4 1
 2 0