// File: pointer4.cpp // // Demonstrating pointer arithmetic // #include using namespace std; int main() { int A[10] = { 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 } ; int *ptr ; ptr = A ; ptr[3] = 333 ; for (int i=0 ; i < 10 ; i++) { cout << *ptr << " " ; ptr = ptr + 1 ; // cout << ptr << endl ; } cout << endl ; }