fork(323) download
  1. #include <stdio.h>
  2. #include <unistd.h>
  3.  
  4. int main()
  5. {
  6. int a=5;
  7. if (fork() == 0)
  8. {
  9. a = a + 5;
  10. printf("%d, %d \n", a, &a);
  11. }
  12. else
  13. {
  14. a = a - 5;
  15. printf ("%d, %d \n", a,& a);
  16. }
  17. return 0;
  18. }
Success #stdin #stdout 0.02s 1676KB
stdin
Standard input is empty
stdout
0, -1073878908 
10, -1073878908