/* * Copyright (C) 1996-1998 Ilya Ryzhenkov (orangy@inetlab.com) * Simple exception throw/catch test */ #include #include // In case you want to test in non-DLM environment uncomment this line : // #define LoadDLM(p) 1 // and compile and link tstexcp.cc in usual way void func(int n) throw(int) { printf("Throwing ...\n"); throw(n); printf("Not thrown?!\n"); } int main(int argc, char **argv) { if (!LoadDLM("libc.dlm")) { printf("No libc.\n"); return 0; } try { printf("Calling func ...\n"); func(10); printf("Returned from func?!\n"); } catch(int eh) { printf("Caught integer %d\n",eh); } }