/* testpointer3.cpp CIS 150 David Klick 6/28/05 Using pointers with an array. */ #include using std::cout; int main(void) { int i, nums[10]; // fill array with even numbers starting with 2 for (i=0; i<10; i++) { // *(nums+i) is equivalent to: nums[i] *(nums+i) = (i+1) * 2; } // display array for (i=0; i<10; i++) { cout << *(nums+i) << ' '; } cout << "\n\n"; return 0; }