/
githubmirror
/
CPlusPlusThings
Обзор
Документация
Войти
/
githubmirror
/
CPlusPlusThings
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
practical_exercises/key_exercises/try.cpp
25 строк
382 B
zhangxing
support bazel complie this project and format code.
30 мар 2024, 17:00
30 мар 2024, 17:00
3c8a3f2
Код
Авторство
О чём код?
/* 异常捕获.cpp */ #include <iostream> using namespace std; //函数异常可以抛出去由主函数来处理 void fun(int x) { try { if (x == 0) throw "异常"; } catch (...) { cout << "in fun" << endl; throw 1; } } int main(int argc, char const *argv[]) { try { fun(0); } catch (int n) { cout << "in main" << endl; } return 0; }