fork(4) download
  1. #include <stdio.h>
  2.  
  3. int x = 0;
  4.  
  5. void foo(int value)
  6. {
  7. printf("x=%d, value=%d\n", x, value);
  8. }
  9.  
  10. int main()
  11. {
  12. foo(++x);
  13. foo(x++); /* note in output x is already incremented */
  14. }
Success #stdin #stdout 0s 2248KB
stdin
Standard input is empty
stdout
x=1, value=1
x=2, value=1