fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // pointer
  6. int x=7;
  7. int* pointer=&x;
  8. cout<<"value the address hold which this pointer hold: "<<*pointer<<endl;
  9. cout<<&x<<endl;
  10. cout<<pointer<<endl;
  11.  
  12. *pointer=89;
  13. cout<<x<<endl;
  14. cout<<*pointer<<endl;
  15.  
  16. cout<<&pointer<<endl; // address of pointer
  17.  
  18. //pointer ka pointer
  19. int** pp=&pointer;
  20. **pp=77;
  21. cout<<x<<endl;
  22. cout<<*pointer<<endl;
  23. cout<<**pp<<endl;
  24. cout<<*pp<<endl;
  25.  
  26.  
  27.  
  28. return 0;
  29. }
Success #stdin #stdout 0s 5324KB
stdin
Standard input is empty
stdout
value the address hold which this pointer hold: 7
0x7ffcab21f5ec
0x7ffcab21f5ec
89
89
0x7ffcab21f5f0
77
77
77
0x7ffcab21f5ec