fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. int a = 10;
  7. int b = 20;
  8. int &alink = a;
  9. int *aptr = &a;
  10. cout << "&a\t: " << &a << endl;
  11. cout << alink << "\t&alink\t: " << &alink << endl;
  12. cout << "&aptr\t: " << &aptr << endl;
  13. alink = b;
  14. cout << alink << "\t&alink\t: " << &alink << endl;
  15. return 0;
  16. }
Success #stdin #stdout 0.01s 5544KB
stdin
Standard input is empty
stdout
&a	: 0x7fffc976d62c
10	&alink	: 0x7fffc976d62c
&aptr	: 0x7fffc976d630
20	&alink	: 0x7fffc976d62c