第十五章C++之异常处理.ppt

int main() { //ff(); try{ int j=0; double d=2.3; char str[20]=Hello; string str1=String; coutPlease input a exception number: ; int a; cina; switch(a){ case 1: throw d; case 2: throw j; case 3: throw str; case 4: throw A(); case 5: throw B(); case 6: str1+=6; throw str1; case 7: str1+=7; throw (string *)str1; case 8: throw(new CExp(CExp)); default: coutNo throws here.\n; } }catch(int){ coutint exception.\n; }catch(double){ coutdoubl

文档评论(0)

1亿VIP精品文档

相关文档