fork download
  1. #include <iostream>
  2.  
  3.  
  4. int address_of_y(int& y){
  5. std::cout << &y << '\n';
  6. return 0;
  7. }
  8.  
  9. class Example{
  10. int x, y;
  11.  
  12. public:
  13. Example() : x(address_of_y(y)), y(10){
  14. std::cout << &y;
  15. }
  16. };
  17.  
  18. int main(){
  19. Example();
  20. return 0;
  21. }
  22.  
Success #stdin #stdout 0s 2852KB
stdin
Standard input is empty
stdout
0xbfc7544c
0xbfc7544c