fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.  
  6.  
  7. long long int a = 5;
  8. long long int &ref = a;
  9.  
  10. printf("%d = a\n", sizeof(a));
  11. printf("%d = ref\n", sizeof(ref));
  12. printf("%d = &ref\n", sizeof(&ref));
  13.  
  14. printf("%p = &a\n", &a);
  15. printf("%p = &ref\n", &ref);
  16.  
  17. return 0;
  18. }
Success #stdin #stdout 0s 3096KB
stdin
Standard input is empty
stdout
8 = a
8 = ref
4 = &ref
0xbff398d8 = &a
0xbff398d8 = &ref