fork download
  1. /******************************************************************************
  2.  
  3.   Online C++ Compiler.
  4.   Code, Compile, Run and Debug C++ program online.
  5. Write your code in this editor and press "Run" button to compile and execute it.
  6.  
  7. *******************************************************************************/
  8.  
  9. #include <iostream>
  10.  
  11. using namespace std;
  12.  
  13. int a, b, c, d;
  14.  
  15. // global variables initially 0
  16. void g1(int b, int c) {
  17. cout << a << b << c << d << endl;
  18. }
  19. void
  20.  
  21. g2(int a, int b) {
  22. g1(a, c);
  23. }
  24. int
  25.  
  26. g3() {
  27.  
  28. int b;
  29.  
  30. b = 4;
  31.  
  32. g1(a, b);
  33.  
  34. {
  35.  
  36. int c;
  37. int d;
  38. c = 2;
  39. d = 3;
  40. g2(a, b);
  41. }
  42. g1(a, b);
  43.  
  44. return b;
  45. }
  46.  
  47. int main() {
  48.  
  49. int a;
  50.  
  51. a = 5;
  52.  
  53. b = 7;
  54.  
  55. a = g3();
  56.  
  57. g3(); // return value ignored
  58. }
Success #stdin #stdout 0s 5300KB
stdin
Standard input is empty
stdout
0040
0000
0040
0040
0000
0040