// File: vtest1.cpp // // Vectors can throw exceptions too. #include #include #include using namespace std ; int main() { vector V(5) ; try { V.at(7) = 17 ; } catch (out_of_range) { cerr << "oops!\n" ; } cout << "Do other stuff\n" ; }