fork download
  1. #include <iostream>
  2. #include <memory>
  3. using namespace std;
  4.  
  5. struct A { int& ref = i; int i; };
  6.  
  7. int main()
  8. {
  9. A a;
  10.  
  11. cout << addressof(a) << endl;
  12. cout << addressof(a.i) << endl;
  13. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
0xbfc01c08
0xbfc01c0c