fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void foov(int x)
  5. {
  6. cout << "> foov x=" << x << endl;
  7. x = 55;
  8. cout << "< foov x=" << x << endl;
  9. }
  10.  
  11. void foor(int& x)
  12. {
  13. cout << "> foor x=" << x << endl;
  14. x = 77;
  15. cout << "< foor x=" << x << endl;
  16. }
  17.  
  18. int main() {
  19. int a = 12;
  20. cout << "a=" << a << endl;
  21. foov(a);
  22. cout << "a=" << a << endl;
  23. cout << " ---" << endl;
  24. cout << "a=" << a << endl;
  25. foor(a);
  26. cout << "a=" << a << endl;
  27. return 0;
  28. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
a=12
> foov x=12
< foov x=55
a=12
 ---
a=12
> foor x=12
< foor x=77
a=77