Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- class Exept
- {
- public:
- std::string tmp;
- Exept() {}
- ~Exept()
- {
- if (!tmp.empty()) {
- std::cout << tmp << std::endl;
- }
- }
- };
- void func()
- {
- Exept a;
- try {
- if (std::cin >> a.tmp) {
- throw 1;
- } else {
- throw '1';
- }
- } catch (const int &a) {
- func();
- }
- catch (...) {
- }
- }
- int main()
- {
- func();
- }
Advertisement
Add Comment
Please, Sign In to add comment