error2.cpp

error2.cpp

#include ‹stl.h›

// Compile this code with the symbol OS_USE_EXCEPTIONS defined.

int main() {

 vector‹int› v;

 try {

  v.pop_back(); // Generates an exception.

 } catch (const char* str) {

  cout ‹‹ "Caught exception " ‹‹ str ‹‹ endl;

 }

 return 0;

}