fork download
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. int main(){
  5. int p[5][4] = {
  6. { 3, 1 },
  7. { 41, 15, 27 },
  8. { 120, 250, 170 },
  9. { 2200, 1100 },
  10. { 5003,9004,6007,8001 }
  11. };
  12.  
  13. cout << "Adresses:" << endl;
  14. for(int i = 0; i < 5; ++i)
  15. cout << "p[" << i << "]: " << (uintptr_t)(p + i) << endl;
  16.  
  17.  
  18. cout << "\nValues:" << endl
  19. << "**p: " << **p << endl
  20. << "(*p)[1]: " << (*p)[1] << endl
  21. << "p[1][1]: " << p[1][1] << endl
  22. << "*(p+2): " << (uintptr_t)(*(p + 2)) << endl
  23. << "*p+2: " << (uintptr_t)(*p + 2) << endl
  24. << "*p[2]: " << *p[2] << endl;
  25. return 0;
  26. }
  27.  
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
Adresses:
p[0]: 3218860160
p[1]: 3218860176
p[2]: 3218860192
p[3]: 3218860208
p[4]: 3218860224

Values:
**p: 3
(*p)[1]: 1
p[1][1]: 15
*(p+2): 3218860192
*p+2: 3218860168
*p[2]: 120