// B3.cpp #include using namespace std; template void throwIfBigger(const T array[], int n, const int MAX) { int i; for(i=0; i MAX) throw "is bigger\n"; } void main() { double array[4] = { 1, 10, 100, 1000 }; try { throwIfBigger(array,4,10000); } catch(char * msg) { cout << "MAX is " << 10000 << ". An array element " << msg; } try { throwIfBigger(array,4,100); } catch(char * msg) { cout << "MAX is " << 100 << ". An array element " << msg; } }