// test the throw #include<iostream> using namespace std; void func() { cout << "generate exception" << endl; throw 5; } int main() { try{ func(); } catch(int value) { cout << "accept exception " << endl; } return 0; }
原文:https://www.cnblogs.com/zijidefengge/p/12453802.html