c++ try catch throw 簡單用法

tyr catch throw 是c++的異常處理機制,當程序遇到一些意外的錯誤,(好比除數爲0) 這是程序員能夠使用一些基本的方法來處理這些異常ios 首先看一個處理除數遇到0的例子c++ #include <iostream> using std::cout; using std::cin; using std::cerr; int fun(int & a, int & b) { if(b
相關文章
相關標籤/搜索