#include using namespace std; // stop pointer does not modify its contents void increment_all (int* start, const int* stop) { while (start != stop) { ++(*start); // increment value pointed ++start; // increment pointer } } // start & stop pointers do not modify their contents void print_all (const int* start, const int* stop) { while (start != stop) { cout << *start << endl; ++start; // increment pointer } } int main () { int numbers[] = {10,20,30}; increment_all (numbers,numbers+3); print_all (numbers,numbers+3); return 0; }