Where are longjmp and setjmp used in C++?
-Setjmp and longjmp must not be used in C++.
- Longjmp jumps out of the function without unwinding stack. This means that local objects generated aren't destructed properly.
- The better option is to use try/throw/catch instead. They properly destruct local objects.