fork download
  1. #include <stdio.h>
  2. using namespace std;
  3.  
  4. int foo(int b){
  5. static int x = 0;
  6. if( b == 10)
  7. {
  8. printf("%d\n", x);
  9. return 10;}
  10. b++;
  11.  
  12. x++;
  13. return foo(b);}
  14.  
  15. main(){
  16. int a = 5;
  17. int y = foo(a);
  18. printf("%d\n", y);
  19. printf("%d\n", a);
  20. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
5
10
5