⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 throw2.cpp

📁 压缩包里有教材<<C++模式设计-基于QT4开源跨平台开发框架>>所有源码
💻 CPP
字号:
#include <iostream>void foo() {    int  i, j;    i = 14;    j = 15;    throw i;}void call_foo() {    int  k;    k  = 12;    foo();}int main() {    using namespace std;    try {        cout << "In the outer try block" << endl;        try {            call_foo(); /* foo exited with i and j destroyed */        }        catch(int n) {            cout << "I can't handle this exception!" << endl;            throw;        }    }     catch(float z) {        cout << "Wrong catch!" << endl;    }    catch(char s) {        cout << "This is also wrong!" << endl;    }    catch(int n) {        cout << "\ncaught it " << n << endl;    }    cout << "Just below the outermost try block." << endl;}/*OutIn the outer try blockI can't handle this exception! caught it 14Just below the outermost try block.*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -