#include #include using namespace std; //Old style before c++ 11 void method1() throw() { } //Recommended style after c++ 11 //It means the method2 does not throw //an exception void method2() noexcept { } //This means the method3 does not throw //an exception. void method3() throw() { throw 5 ; } int main() { try { method3() ; } catch ( int& err ) { cout << "Inside catch." << endl ; } return 0; }