#include #include using namespace std; const size_t MAX_SIZE = 10; void PrintArrays(int low[MAX_SIZE], int ary[MAX_SIZE], int high[MAX_SIZE]); int main() { int low[MAX_SIZE]; int ary[MAX_SIZE]; int high[MAX_SIZE]; int i; size_t j; // print out the uninitialized arrays cout << "Uninitialized arrays" << endl; PrintArrays(low, ary, high); cout << endl; // initialize high and low for(j = 0; j < MAX_SIZE; j++) { low[j] = 99; ary[j] = 0; high[j] = 99; } cout << "After Initialization " << endl; PrintArrays(low, ary, high); cout << endl; // do an out of bounds error. for(i = -10; i < 20; i++) { ary[i] = i; } cout << "After oob error " << endl; PrintArrays(low, ary, high); cout << endl; return 0; } void PrintArrays(int low[MAX_SIZE], int ary[MAX_SIZE], int high[MAX_SIZE]){ size_t i; for(i=0; i < MAX_SIZE; i++) { cout << setw(3) << i << setw(10) << low[i] << setw(10) << ary[i] << setw(10) << high[i] << endl; } return; }