c_-_c_exception_handling:c_exceptions
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
c_-_c_exception_handling:c_exceptions [2017/10/12 10:28] – created peter | c_-_c_exception_handling:c_exceptions [2017/10/12 10:31] (current) – removed peter | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | |||
- | <code cpp> | ||
- | #include < | ||
- | using namespace std; | ||
- | |||
- | int main() | ||
- | { | ||
- | cout << " | ||
- | |||
- | try { | ||
- | cout << " | ||
- | throw 1; // throw an error | ||
- | cout << "This will not execute"; | ||
- | } | ||
- | catch (int i) { // catch an error | ||
- | cout << " | ||
- | cout << i << " | ||
- | } | ||
- | cout << " | ||
- | return 0; | ||
- | } | ||
- | </ | ||
c_-_c_exception_handling/c_exceptions.1507804119.txt.gz · Last modified: 2020/07/15 09:30 (external edit)