Array Echo With Pointers
/* * Read some integers into an array, then echo them, using pointers. */ #include <iostream> using namespace std; const int ARRMAX = 100; main() { /* Read them in. */ int arr[ARRMAX]; /* Array of numbers. */ int *scan = arr; cout << "Enter some integers: " << endl; while(cin >> *scan) ++scan; int *end = scan; /* Print them back out again. */ cout << "===============" << endl; for(scan = arr; scan < end; ++scan) cout << *scan << " "; cout << endl; }