Try Catch异常处理
Trty Catch
异常处理的一些操作和步骤
一个try可以对应对个catch
1234567891011f(int a){ if( a < 1 ) throw a;}try{ }catch(int){ cout << "a小于1";}
可以单独写一个类处理和接受异常
12345678910111213141516171819202122232425262728293031323334#include <iostream>using namespace std;//异常类class listException{pubilc: listException(string str):str(str){} void print() { cout << str <<endl; }protected: string str ...