// Project PointerArithmetic // File pointer_arithmetic.cpp #include using namespace std; int main() { int a[] = {23, 64, 82, 19, 36, 80}; int i, *p; // Traditional array processing // using indices. for(i = 0; i <= 5; i++) cout << a[i] << " "; cout << endl; // Array processing using pointers. for(p = a; p <= a + 5; p++) cout << *p << " "; cout << endl; // Another version of array processing // using pointers. for(i = 0; i <= 5; i++) cout << *(a + i) << " "; cout << endl; return EXIT_SUCCESS; } // Output: // 23 64 82 19 36 80 // 23 64 82 19 36 80 // 23 64 82 19 36 80