fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int x = 5;
  6. int* p = &x;
  7.  
  8. printf("x address: %p\n", &x);
  9. printf("p value: %p\n", p);
  10. printf("p address: %p\n", &p);
  11.  
  12. cout << "p address through cout:" << &p << endl;
  13.  
  14. return 0;
  15. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
x address: 0xbfb80b38
p value: 0xbfb80b38
p address: 0xbfb80b3c
p address through cout:0xbfb80b3c