#include #include using namespace std; int main() { int a[] = {10, 20, 30}; const size_t n = sizeof a / sizeof a[0]; for (size_t i = 0; i < n; ++i) { cout << "a[" << i << "]: address is " << a + i << ", value is " << a[i] << ".\n"; } cout << "\n"; for (int *p = a; p < a + n; ++p) { cout << "a[" << p - a << "]: address is " << p << ", value is " << *p << ".\n"; } return EXIT_SUCCESS; }