fork download
  1. #include <iostream>
  2.  
  3. int main()
  4. {
  5. using namespace std;
  6.  
  7. int x = 1;
  8. int const& ri = x;
  9. long const& rl = x;
  10.  
  11. cout << &x << endl;
  12. cout << &ri << endl;
  13. cout << &rl << endl;
  14.  
  15. cout << endl;
  16.  
  17. cout << x << ' ' << ri << ' ' << rl << endl;
  18. x++;
  19. cout << x << ' ' << ri << ' ' << rl << endl;
  20. }
Success #stdin #stdout 0s 2896KB
stdin
Standard input is empty
stdout
0xbfa8c388
0xbfa8c388
0xbfa8c38c

1 1 1
2 2 1