fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main ()
  6. {
  7. int x = 10;
  8. const int &r = x;
  9. cout << x << ", " << r << endl;
  10. x = 20;
  11. cout << x << ", " << r << endl;
  12. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
10, 10
20, 20