/
githubmirror
/
CPlusPlusThings
Обзор
Документация
Войти
/
githubmirror
/
CPlusPlusThings
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
practical_exercises/10_day_practice/day9/exception/5.cpp
25 строк
464 B
zhangxing
support bazel complie this project and format code.
30 мар 2024, 17:00
30 мар 2024, 17:00
3c8a3f2
Код
Авторство
О чём код?
// Eg10-5.cpp #include <iostream> using namespace std; void handler(int n) throw(int, char, double) { if (n == 1) throw n; if (n == 2) throw 'x'; if (n == 3) throw 1.1; } int main() { cout << "Before handler..." << endl; try { handler(1); } catch (int i) { cout << "catch an integer..." << endl; } catch (char c) { cout << "catch an char..." << endl; } catch (double d) { cout << "catch an double..." << endl; } }