First page Back Continue Last page Graphics
13.3 Other Error-Handling Techniques
setjump and longjump
- <csetjmp>
- Jump from deeply nested function to call error handler
- Can be dangerous
Dedicated error handling
- new can have a special handler
- When operator new fails, it throws a bad_alloc exception (defined in the header file <new>)
- try { allocate memory using new }
- catch (bad_alloc &memoryAl;locationException)
- { ... }