fork download
  1. #include <iostream>
  2. #include <cstdio>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. int j = 2;
  9. int &i = j;
  10. if(i==j)
  11. puts(" i==j ");
  12. else
  13. puts(" i!=j ");
  14.  
  15. if(&i==&j)
  16. puts(" &i==&j ");
  17. else
  18. puts(" &i!=&j ");
  19. return 0;
  20. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
 i==j 
 &i==&j