fork download
  1. #include <iostream>
  2.  
  3. using std::cout;
  4. using std::endl;
  5.  
  6. int main()
  7. {
  8. int x = 20;
  9. const auto &rx1 = x;
  10. const auto &rx2 = x;
  11.  
  12. x = 10;
  13. cout << "rx1: " << rx1 << endl;
  14. cout << "rx2: " << rx2 << endl;
  15.  
  16. return 0;
  17. }
Success #stdin #stdout 0s 16048KB
stdin
Standard input is empty
stdout
rx1: 10
rx2: 10