fork(1) download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int foo = 100;
  6.  
  7. int bar(int foo)
  8. {
  9. int sum = foo + ::foo; // sum adds local variable and a global variable
  10. return sum;
  11. }
  12.  
  13. int main()
  14. {
  15. int result = bar(12);
  16. cout << result << endl;
  17. return 0;
  18. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
112