try语句块与异常处理 throw表达式 表示遇到了无法处理的异常,抛出异常 try 以try开始,多个catch结束,try语句块中抛出的异常会被catch子句处理 try{ //do something throw runtime_err("an error"); }catch(exception-declaration){ //deal the exception } //try中的局部变量catch子句无法访问