fork(12) download
  1. #include <iostream>
  2. using namespace std;
  3. void myFunc(); // Function prototype
  4. int main()
  5. { int var = 100;
  6. cout << var << endl;
  7. myFunc();
  8. cout << var << endl;
  9. return 0;
  10. }
  11. // Definition of function myFunc
  12. void myFunc()
  13. { int var = 50;
  14. cout << var << endl;
  15. }
  16.  
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
100
50
100