// B3b.cpp // compiles with Borland C++ 5.0 // does not compile with visual C++ 5.0 due to reference argument #include 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; } }