fork download
  1. #include <iostream>
  2.  
  3. int main()
  4. {
  5. int A = 10;
  6. int B = 20;
  7.  
  8. int& foo = A;
  9.  
  10. std::cout << foo << "\n";
  11.  
  12. foo = B;
  13.  
  14. std::cout << foo << "\n";
  15. }
Success #stdin #stdout 0s 4244KB
stdin
Standard input is empty
stdout
10
20