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
相关文章
相关标签/搜索