fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. int a[10]={1,2,5,6,6,4,3,2,2,2};
  7. int *b = a+2;
  8. cout << b << endl;
  9. cout << &b << endl;
  10. cout << a+2 << endl;
  11. cout << &a << endl;
  12. cout << a << endl;
  13. cout<<*(a+2)<<endl;
  14. cout<<*(a);
  15. }
Success #stdin #stdout 0.01s 5280KB
stdin
Standard input is empty
stdout
0x7ffc8245b9d8
0x7ffc8245b9c8
0x7ffc8245b9d8
0x7ffc8245b9d0
0x7ffc8245b9d0
5
1