Mega Code Archive
Categories
/
C++
/
Language
Throwing Exceptions
#include
using namespace std; void foo() { int i; i = -15; throw i; } int main() { try { foo(); } catch(int n) { cerr << "exception caught\n " << n << endl; } }