fork download
  1. #include <iostream>
  2.  
  3. void foo(int &x) {
  4. x = 10;
  5. }
  6.  
  7. int main() {
  8. int x = 512;
  9.  
  10. foo(x);
  11.  
  12. std::cout << x << std::endl;
  13. }
Success #stdin #stdout 0s 4388KB
stdin
Standard input is empty
stdout
10