// 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; }
throw() 可以抛出异常
猜你喜欢
转载自www.cnblogs.com/zijidefengge/p/12453802.html
今日推荐
周排行