// File: tdtest10.cpp // // This file checks that version 10 of // the TwoDimArray class works. // // Version 10 throws exceptions // #include #include "twodim10.h" using namespace std ; int main() { TwoDimArray A(5,5) ; try { // other code A[2][1] = 17 ; A[5][2] = 9 ; // other code } catch (OutOfBounds) { cerr << "Oops! Out of Bounds detected!\n" ; // preparation for exit (e.g., close files) exit(1) ; } }