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