fork download
  1. #include <stdio.h>
  2. int gSum;
  3.  
  4. int foo1(int n){
  5. printf("%d\n" , gSum);
  6. gSum = gSum + n;
  7. return (gSum + 1);
  8. }
  9.  
  10. int foo2(int n){
  11. int gSum = n;
  12. return (gSum + 1);
  13. }
  14. int main(void){
  15. int nx;
  16.  
  17. gSum =0;
  18. nx= foo1(foo2(1));
  19. printf("nx=%d,gSum=%d\n",nx,gSum);
  20. return 0;
  21. }
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
0
nx=3,gSum=2