fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int i=-2,*p;
  6. double j=1.5,*q;
  7. p=&i;q=&j;
  8. cout <<hex<<&p<<','<<&q<<endl;
  9. cout <<hex<<p<<','<<q<<endl;
  10. cout <<hex<<&i<<','<<&j<<endl;
  11. cout <<dec<<*p<<','<<*q<<endl;
  12. cout <<dec<<i<<','<<j<<endl;
  13. cout<<sizeof(p)<<sizeof(q);
  14. cout<<sizeof(&p)<<sizeof(&q);
  15. cout<<sizeof(&i)<<sizeof(&j)<<endl;
  16. return 0;
  17. }
Success #stdin #stdout 0.01s 5524KB
stdin
Standard input is empty
stdout
0x7ffdcda98650,0x7ffdcda98660
0x7ffdcda9864c,0x7ffdcda98658
0x7ffdcda9864c,0x7ffdcda98658
-2,1.5
-2,1.5
888888